@sheet-i18n/react-client 1.5.0-canary.4 → 1.5.0-canary.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -162,6 +162,7 @@ function IntlProvider({
162
162
  children
163
163
  }) {
164
164
  const { locale } = useIntlLocale({ i18nStore, currentLocale });
165
+ console.log("\u2705 locale in IntlProvider", locale);
165
166
  const onIntlError = (err) => {
166
167
  const typeSafe = i18nStore.typeSafe;
167
168
  if (typeSafe) {
@@ -175,7 +176,7 @@ function IntlProvider({
175
176
  locale,
176
177
  messages: i18nStore == null ? void 0 : i18nStore.localeSet[locale],
177
178
  onError: onIntlError,
178
- children: !isLoading && children
179
+ children
179
180
  }
180
181
  );
181
182
  }
@@ -227,41 +228,23 @@ var TranslationService = class {
227
228
  });
228
229
  }
229
230
  findTargetTranslation(id, $tParams) {
230
- var _a, _b, _c, _d, _e, _f, _g;
231
- console.log(
232
- "1) \u2705 intlInstance in findTargetTranslation",
233
- this == null ? void 0 : this.intlInstance
234
- );
231
+ var _a, _b, _c, _d, _e;
235
232
  const targetTranslation = (_b = (_a = this == null ? void 0 : this.intlInstance) == null ? void 0 : _a.messages) == null ? void 0 : _b[id];
236
233
  if (import_shared_utils3.validator.isNullish(targetTranslation)) {
237
234
  return id;
238
235
  }
239
- console.log(
240
- "2) \u2705 targetTranslation in findTargetTranslation",
241
- targetTranslation
242
- );
243
236
  if (typeof targetTranslation === "string" && targetTranslation.trim() === "") {
244
237
  return "";
245
238
  }
246
- console.log("3) \u2705 $tParams in findTargetTranslation", $tParams);
247
239
  if (!$tParams || !($tParams == null ? void 0 : $tParams.descriptor)) {
248
240
  return "";
249
241
  }
250
- console.log(
251
- "4) \u2705 $tParams.descriptor in findTargetTranslation",
252
- (_d = (_c = this.intlInstance) == null ? void 0 : _c.$t) == null ? void 0 : _d.call(
253
- _c,
254
- $tParams.descriptor,
255
- $tParams.values,
256
- $tParams.opts
257
- )
258
- );
259
- return (_g = (_f = (_e = this.intlInstance) == null ? void 0 : _e.$t) == null ? void 0 : _f.call(
260
- _e,
242
+ return (_e = (_d = (_c = this.intlInstance) == null ? void 0 : _c.$t) == null ? void 0 : _d.call(
243
+ _c,
261
244
  $tParams.descriptor,
262
245
  $tParams.values,
263
246
  $tParams.opts
264
- )) != null ? _g : "";
247
+ )) != null ? _e : "";
265
248
  }
266
249
  };
267
250
 
@@ -477,13 +460,11 @@ var LISTENER_ID = "LOCALE_STORAGE_LISTENER_ID";
477
460
  function useLocaleStorage(localeStorageManager) {
478
461
  var _a;
479
462
  const [locale, setLocale] = (0, import_react3.useState)((_a = localeStorageManager == null ? void 0 : localeStorageManager.getLocale) == null ? void 0 : _a.call(localeStorageManager));
480
- console.log("\u2705 locale in useLocaleStorage", locale);
481
463
  (0, import_react3.useEffect)(() => {
482
464
  var _a2;
483
465
  (_a2 = localeStorageManager == null ? void 0 : localeStorageManager.observerManager) == null ? void 0 : _a2.addListener({
484
466
  listenerId: LISTENER_ID,
485
467
  listener: (newLocale) => {
486
- console.log("\u2705 did you update the locale?", newLocale);
487
468
  setLocale(newLocale);
488
469
  }
489
470
  });
package/dist/index.mjs CHANGED
@@ -139,6 +139,7 @@ function IntlProvider({
139
139
  children
140
140
  }) {
141
141
  const { locale } = useIntlLocale({ i18nStore, currentLocale });
142
+ console.log("\u2705 locale in IntlProvider", locale);
142
143
  const onIntlError = (err) => {
143
144
  const typeSafe = i18nStore.typeSafe;
144
145
  if (typeSafe) {
@@ -152,7 +153,7 @@ function IntlProvider({
152
153
  locale,
153
154
  messages: i18nStore == null ? void 0 : i18nStore.localeSet[locale],
154
155
  onError: onIntlError,
155
- children: !isLoading && children
156
+ children
156
157
  }
157
158
  );
158
159
  }
@@ -204,41 +205,23 @@ var TranslationService = class {
204
205
  });
205
206
  }
206
207
  findTargetTranslation(id, $tParams) {
207
- var _a, _b, _c, _d, _e, _f, _g;
208
- console.log(
209
- "1) \u2705 intlInstance in findTargetTranslation",
210
- this == null ? void 0 : this.intlInstance
211
- );
208
+ var _a, _b, _c, _d, _e;
212
209
  const targetTranslation = (_b = (_a = this == null ? void 0 : this.intlInstance) == null ? void 0 : _a.messages) == null ? void 0 : _b[id];
213
210
  if (validator3.isNullish(targetTranslation)) {
214
211
  return id;
215
212
  }
216
- console.log(
217
- "2) \u2705 targetTranslation in findTargetTranslation",
218
- targetTranslation
219
- );
220
213
  if (typeof targetTranslation === "string" && targetTranslation.trim() === "") {
221
214
  return "";
222
215
  }
223
- console.log("3) \u2705 $tParams in findTargetTranslation", $tParams);
224
216
  if (!$tParams || !($tParams == null ? void 0 : $tParams.descriptor)) {
225
217
  return "";
226
218
  }
227
- console.log(
228
- "4) \u2705 $tParams.descriptor in findTargetTranslation",
229
- (_d = (_c = this.intlInstance) == null ? void 0 : _c.$t) == null ? void 0 : _d.call(
230
- _c,
231
- $tParams.descriptor,
232
- $tParams.values,
233
- $tParams.opts
234
- )
235
- );
236
- return (_g = (_f = (_e = this.intlInstance) == null ? void 0 : _e.$t) == null ? void 0 : _f.call(
237
- _e,
219
+ return (_e = (_d = (_c = this.intlInstance) == null ? void 0 : _c.$t) == null ? void 0 : _d.call(
220
+ _c,
238
221
  $tParams.descriptor,
239
222
  $tParams.values,
240
223
  $tParams.opts
241
- )) != null ? _g : "";
224
+ )) != null ? _e : "";
242
225
  }
243
226
  };
244
227
 
@@ -454,13 +437,11 @@ var LISTENER_ID = "LOCALE_STORAGE_LISTENER_ID";
454
437
  function useLocaleStorage(localeStorageManager) {
455
438
  var _a;
456
439
  const [locale, setLocale] = useState2((_a = localeStorageManager == null ? void 0 : localeStorageManager.getLocale) == null ? void 0 : _a.call(localeStorageManager));
457
- console.log("\u2705 locale in useLocaleStorage", locale);
458
440
  useEffect2(() => {
459
441
  var _a2;
460
442
  (_a2 = localeStorageManager == null ? void 0 : localeStorageManager.observerManager) == null ? void 0 : _a2.addListener({
461
443
  listenerId: LISTENER_ID,
462
444
  listener: (newLocale) => {
463
- console.log("\u2705 did you update the locale?", newLocale);
464
445
  setLocale(newLocale);
465
446
  }
466
447
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheet-i18n/react-client",
3
- "version": "1.5.0-canary.4",
3
+ "version": "1.5.0-canary.5",
4
4
  "description": "a client package for react modules used by sheet-i18n",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",