@orderly.network/i18n 2.12.4-alpha.0 → 3.0.0-alpha.0
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.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -105,4 +105,9 @@ declare function useLocaleCode(): LocaleCode;
|
|
|
105
105
|
*/
|
|
106
106
|
declare function useRegisterExternalResources(resources?: Resources | AsyncResources): void;
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
/**
|
|
109
|
+
* preload default locale resources to prevent flickering of raw translation keys
|
|
110
|
+
*/
|
|
111
|
+
declare const preloadDefaultResource: (messages: Record<string, string>) => void;
|
|
112
|
+
|
|
113
|
+
export { AsyncResources, Backend, type BackendOptions, ExternalLocaleProvider, type ExternalLocaleProviderProps, LanguageContextState, LanguageProvider, type LanguageProviderProps, LocaleCode, type LocaleJsonModule, LocaleProvider, type LocaleProviderProps, Resources, asMessageRecord, createI18nInstance, i18n, importLocaleJsonModule, preloadDefaultResource, registerDefaultResource, registerResources, useLocaleCode, useRegisterExternalResources, useTranslation };
|
package/dist/index.d.ts
CHANGED
|
@@ -105,4 +105,9 @@ declare function useLocaleCode(): LocaleCode;
|
|
|
105
105
|
*/
|
|
106
106
|
declare function useRegisterExternalResources(resources?: Resources | AsyncResources): void;
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
/**
|
|
109
|
+
* preload default locale resources to prevent flickering of raw translation keys
|
|
110
|
+
*/
|
|
111
|
+
declare const preloadDefaultResource: (messages: Record<string, string>) => void;
|
|
112
|
+
|
|
113
|
+
export { AsyncResources, Backend, type BackendOptions, ExternalLocaleProvider, type ExternalLocaleProviderProps, LanguageContextState, LanguageProvider, type LanguageProviderProps, LocaleCode, type LocaleJsonModule, LocaleProvider, type LocaleProviderProps, Resources, asMessageRecord, createI18nInstance, i18n, importLocaleJsonModule, preloadDefaultResource, registerDefaultResource, registerResources, useLocaleCode, useRegisterExternalResources, useTranslation };
|
package/dist/index.js
CHANGED
|
@@ -1760,6 +1760,11 @@ function useTranslation(ns, options) {
|
|
|
1760
1760
|
});
|
|
1761
1761
|
}
|
|
1762
1762
|
|
|
1763
|
+
// src/external/utils.ts
|
|
1764
|
+
var preloadDefaultResource = (messages) => {
|
|
1765
|
+
i18n_default.addResourceBundle(defaultLng, defaultNS, messages, true, true);
|
|
1766
|
+
};
|
|
1767
|
+
|
|
1763
1768
|
Object.defineProperty(exports, "createInstance", {
|
|
1764
1769
|
enumerable: true,
|
|
1765
1770
|
get: function () { return i18next.createInstance; }
|
|
@@ -1787,6 +1792,7 @@ exports.i18nCookieKey = i18nCookieKey;
|
|
|
1787
1792
|
exports.i18nLocalStorageKey = i18nLocalStorageKey;
|
|
1788
1793
|
exports.importLocaleJsonModule = importLocaleJsonModule;
|
|
1789
1794
|
exports.parseI18nLang = parseI18nLang;
|
|
1795
|
+
exports.preloadDefaultResource = preloadDefaultResource;
|
|
1790
1796
|
exports.registerDefaultResource = registerDefaultResource;
|
|
1791
1797
|
exports.registerResources = registerResources;
|
|
1792
1798
|
exports.removeLangPrefix = removeLangPrefix;
|