@bcrumbs.net/bc-shared 0.0.1 → 0.0.3
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/index.esm.js +5 -2
- package/package.json +2 -6
- package/src/lib/services/i18n/index.d.ts +4 -1
package/index.esm.js
CHANGED
|
@@ -10280,7 +10280,10 @@ $$3({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
|
|
|
10280
10280
|
// import LanguageDetector from 'i18next-browser-languagedetector';
|
|
10281
10281
|
const LOCAL_STORAGE_I18N_STRING = 'I18N_SELECTION';
|
|
10282
10282
|
const systemDefaultLang = 'en';
|
|
10283
|
-
const init = (
|
|
10283
|
+
const init = ({
|
|
10284
|
+
version,
|
|
10285
|
+
customPath
|
|
10286
|
+
}) => {
|
|
10284
10287
|
const currentLng = localStorage.getItem(LOCAL_STORAGE_I18N_STRING) || systemDefaultLang;
|
|
10285
10288
|
i18n.use(Backend) // load translation using http
|
|
10286
10289
|
// .use(LanguageDetector) // detect user language
|
|
@@ -10294,7 +10297,7 @@ const init = () => {
|
|
|
10294
10297
|
},
|
|
10295
10298
|
load: 'languageOnly',
|
|
10296
10299
|
backend: {
|
|
10297
|
-
loadPath:
|
|
10300
|
+
loadPath: customPath ? customPath : `/assets/locales/{{lng}}/{{ns}}.json?v=${version !== null && version !== void 0 ? version : ''}`
|
|
10298
10301
|
}
|
|
10299
10302
|
});
|
|
10300
10303
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrumbs.net/bc-shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"keyword": [
|
|
5
5
|
"bcrumbs",
|
|
6
6
|
"bc-shared",
|
|
@@ -16,11 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"jwt-decode": "^3.1.2",
|
|
19
|
-
"i18next-
|
|
20
|
-
"i18next-http-backend": "^1.3.2",
|
|
21
|
-
"next-with-apollo": "^5.3.0",
|
|
22
|
-
"apollo-cache-inmemory": "^1.6.6",
|
|
23
|
-
"apollo-link-http": "^1.5.17"
|
|
19
|
+
"i18next-http-backend": "^1.3.2"
|
|
24
20
|
},
|
|
25
21
|
"module": "./index.esm.js",
|
|
26
22
|
"type": "module",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const LOCAL_STORAGE_I18N_STRING = "I18N_SELECTION";
|
|
2
2
|
export declare const LangService: {
|
|
3
|
-
init: (
|
|
3
|
+
init: ({ version, customPath, }: {
|
|
4
|
+
version?: string;
|
|
5
|
+
customPath?: string;
|
|
6
|
+
}) => void;
|
|
4
7
|
changeLang: (lang: Languages) => void;
|
|
5
8
|
getLang: () => string;
|
|
6
9
|
};
|