i18n-keyless-react 1.7.6 → 1.7.7
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/package.json +1 -1
- package/dist/store.js +6 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/store.js
CHANGED
|
@@ -106,6 +106,10 @@ export const useI18nKeyless = create((set, get) => ({
|
|
|
106
106
|
if (currentLanguage === config.languages.primary) {
|
|
107
107
|
return text;
|
|
108
108
|
}
|
|
109
|
+
const forceTemporary = options?.forceTemporary;
|
|
110
|
+
if (forceTemporary?.[currentLanguage]) {
|
|
111
|
+
get().translateKey(forceTemporary[currentLanguage], options);
|
|
112
|
+
}
|
|
109
113
|
const context = options?.context;
|
|
110
114
|
const translation = context ? get().translations[`${text}__${context}`] : get().translations[text];
|
|
111
115
|
if (!translation) {
|
|
@@ -135,8 +139,9 @@ export const useI18nKeyless = create((set, get) => ({
|
|
|
135
139
|
if (debug) {
|
|
136
140
|
console.log("translateKey", key, context, debug);
|
|
137
141
|
}
|
|
142
|
+
const forceTemporaryLang = options?.forceTemporary?.[get().currentLanguage];
|
|
138
143
|
const translation = context ? get().translations[`${key}__${context}`] : get().translations[key];
|
|
139
|
-
if (translation) {
|
|
144
|
+
if (translation && !forceTemporaryLang) {
|
|
140
145
|
if (debug) {
|
|
141
146
|
console.log("translation exists", `${key}__${context}`);
|
|
142
147
|
}
|