@sonenta/react-i18next 2.3.0 → 2.3.1
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.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -178,10 +178,10 @@ interface SonentaConfig {
|
|
|
178
178
|
disableLanguageCatalog?: boolean;
|
|
179
179
|
/**
|
|
180
180
|
* Skip the best-effort fetch of the per-version published-languages manifest
|
|
181
|
-
* (`{
|
|
182
|
-
* that powers `i18n.availableLanguages` /
|
|
183
|
-
* skipped (or on a 404), `availableLanguages`
|
|
184
|
-
* `defaultLocale` + `fallbackLng`.
|
|
181
|
+
* (`{apiBase}/cdn/v1/{project}/{version}/latest/languages.json`, public, no
|
|
182
|
+
* auth, CORS-open) that powers `i18n.availableLanguages` /
|
|
183
|
+
* `useAvailableLanguages()`. When skipped (or on a 404), `availableLanguages`
|
|
184
|
+
* falls back to the configured `defaultLocale` + `fallbackLng`.
|
|
185
185
|
*/
|
|
186
186
|
disableLanguageManifest?: boolean;
|
|
187
187
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -178,10 +178,10 @@ interface SonentaConfig {
|
|
|
178
178
|
disableLanguageCatalog?: boolean;
|
|
179
179
|
/**
|
|
180
180
|
* Skip the best-effort fetch of the per-version published-languages manifest
|
|
181
|
-
* (`{
|
|
182
|
-
* that powers `i18n.availableLanguages` /
|
|
183
|
-
* skipped (or on a 404), `availableLanguages`
|
|
184
|
-
* `defaultLocale` + `fallbackLng`.
|
|
181
|
+
* (`{apiBase}/cdn/v1/{project}/{version}/latest/languages.json`, public, no
|
|
182
|
+
* auth, CORS-open) that powers `i18n.availableLanguages` /
|
|
183
|
+
* `useAvailableLanguages()`. When skipped (or on a 404), `availableLanguages`
|
|
184
|
+
* falls back to the configured `defaultLocale` + `fallbackLng`.
|
|
185
185
|
*/
|
|
186
186
|
disableLanguageManifest?: boolean;
|
|
187
187
|
/**
|
package/dist/index.js
CHANGED
|
@@ -210,7 +210,7 @@ function flattenPlurals(tree, locale) {
|
|
|
210
210
|
|
|
211
211
|
// src/transport.ts
|
|
212
212
|
var SDK_LIB = "@sonenta/react-i18next";
|
|
213
|
-
var SDK_VER = true ? "2.3.
|
|
213
|
+
var SDK_VER = true ? "2.3.1" : "0.0.0-dev";
|
|
214
214
|
function defaultTransport(opts) {
|
|
215
215
|
return async (batch) => {
|
|
216
216
|
if (!batch.length) return;
|
|
@@ -747,16 +747,18 @@ var SonentaI18n = class {
|
|
|
747
747
|
* Skipped when disabled; a failure keeps any embedded catalog. */
|
|
748
748
|
/**
|
|
749
749
|
* Best-effort: fetch the per-version published-languages manifest
|
|
750
|
-
* (`{
|
|
751
|
-
* CDN-cached) — the SET of locales
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
750
|
+
* (`{apiBase}/cdn/v1/{project}/{version}/latest/languages.json`, public, no
|
|
751
|
+
* auth, CORS-open, CDN-cached `max-age=60` + ETag) — the SET of locales
|
|
752
|
+
* published for the active version (compute-on-serve from cdn_releases,
|
|
753
|
+
* always in sync with what is published). Codes only; enriched from the
|
|
754
|
+
* catalog. A 404/offline keeps any prior manifest (`availableLanguages` then
|
|
755
|
+
* falls back to default + fallback). Same route on prod + dev (backend task
|
|
756
|
+
* 989+; the authed `/v1/projects/{id}/languages` is ALL project languages,
|
|
757
|
+
* not the published set — this manifest is the in-production set).
|
|
755
758
|
*/
|
|
756
759
|
async _loadManifest(fetchImpl, opts = {}) {
|
|
757
760
|
if (this._manifestDisabled) return;
|
|
758
|
-
|
|
759
|
-
const url = `${this._config.cdnBase.replace(/\/+$/, "")}/p/${this._config.projectUuid}/${this._config.version}/latest/languages.json`;
|
|
761
|
+
const url = `${this._config.apiBase.replace(/\/+$/, "")}/cdn/v1/${this._config.projectUuid}/${this._config.version}/latest/languages.json`;
|
|
760
762
|
const init = { method: "GET", credentials: "omit" };
|
|
761
763
|
if (opts.bust) init.cache = "reload";
|
|
762
764
|
try {
|