update to state of the art

This commit is contained in:
s2
2020-10-10 15:18:01 +02:00
parent cf251a170f
commit 4cdcfd167c
1526 changed files with 48132 additions and 7268 deletions

21
node_modules/i18next/CHANGELOG.md generated vendored
View File

@@ -1,3 +1,24 @@
### 19.8.2
- allow nesting recursively with context (could theoretically generate infinite loop, prevented in [1480](https://github.com/i18next/i18next/pull/1480))
### 19.8.1
- fix "no languageDetector is used" log statement
- do not log "initialized" on cloned instances
### 19.8.0
- allow fallbackLng as function [1508](https://github.com/i18next/i18next/pull/1508)
### 19.7.0
- resource manipulation functions are now chainable
### 19.6.3
- plural rules for ht and iw
### 19.6.2
- fix interpolation with option skipOnVariables when there are multiple placeholders [1490](https://github.com/i18next/i18next/issues/1490)

View File

@@ -715,7 +715,7 @@ var Translator = function (_EventEmitter) {
args[_key] = arguments[_key];
}
if (lastKey && lastKey[0] === args[0]) {
if (lastKey && lastKey[0] === args[0] && !options.context) {
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
return null;
@@ -932,6 +932,7 @@ var LanguageUtil = function () {
key: "getFallbackCodes",
value: function getFallbackCodes(fallbacks, code) {
if (!fallbacks) return [];
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
if (!code) return fallbacks["default"] || [];
@@ -987,7 +988,7 @@ var sets = [{
nr: [1, 2],
fc: 2
}, {
lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
nr: [1],
fc: 3
}, {
@@ -1067,7 +1068,7 @@ var sets = [{
nr: [5, 1, 2, 3],
fc: 21
}, {
lngs: ['he'],
lngs: ['he', 'iw'],
nr: [1, 2, 20, 21],
fc: 22
}];
@@ -1888,11 +1889,11 @@ var I18n = function (_EventEmitter) {
});
}
if (!this.modules.languageDetector && !this.options.lng) {
if (!this.services.languageDetector && !this.options.lng) {
this.logger.warn('init: no languageDetector is used and no lng is defined');
}
var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
storeApi.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store;
@@ -1900,13 +1901,22 @@ var I18n = function (_EventEmitter) {
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
};
});
var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
storeApiChained.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store2;
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
return _this2;
};
});
var deferred = defer();
var load = function load() {
_this2.changeLanguage(_this2.options.lng, function (err, t) {
_this2.isInitialized = true;
_this2.logger.log('initialized', _this2.options);
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
_this2.emit('initialized', _this2.options);

View File

@@ -711,7 +711,7 @@ var Translator = function (_EventEmitter) {
args[_key] = arguments[_key];
}
if (lastKey && lastKey[0] === args[0]) {
if (lastKey && lastKey[0] === args[0] && !options.context) {
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
return null;
@@ -928,6 +928,7 @@ var LanguageUtil = function () {
key: "getFallbackCodes",
value: function getFallbackCodes(fallbacks, code) {
if (!fallbacks) return [];
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
if (!code) return fallbacks["default"] || [];
@@ -983,7 +984,7 @@ var sets = [{
nr: [1, 2],
fc: 2
}, {
lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
nr: [1],
fc: 3
}, {
@@ -1063,7 +1064,7 @@ var sets = [{
nr: [5, 1, 2, 3],
fc: 21
}, {
lngs: ['he'],
lngs: ['he', 'iw'],
nr: [1, 2, 20, 21],
fc: 22
}];
@@ -1884,11 +1885,11 @@ var I18n = function (_EventEmitter) {
});
}
if (!this.modules.languageDetector && !this.options.lng) {
if (!this.services.languageDetector && !this.options.lng) {
this.logger.warn('init: no languageDetector is used and no lng is defined');
}
var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
storeApi.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store;
@@ -1896,13 +1897,22 @@ var I18n = function (_EventEmitter) {
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
};
});
var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
storeApiChained.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store2;
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
return _this2;
};
});
var deferred = defer();
var load = function load() {
_this2.changeLanguage(_this2.options.lng, function (err, t) {
_this2.isInitialized = true;
_this2.logger.log('initialized', _this2.options);
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
_this2.emit('initialized', _this2.options);

View File

@@ -827,7 +827,7 @@
args[_key] = arguments[_key];
}
if (lastKey && lastKey[0] === args[0]) {
if (lastKey && lastKey[0] === args[0] && !options.context) {
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
return null;
@@ -1044,6 +1044,7 @@
key: "getFallbackCodes",
value: function getFallbackCodes(fallbacks, code) {
if (!fallbacks) return [];
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
if (!code) return fallbacks["default"] || [];
@@ -1099,7 +1100,7 @@
nr: [1, 2],
fc: 2
}, {
lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
nr: [1],
fc: 3
}, {
@@ -1179,7 +1180,7 @@
nr: [5, 1, 2, 3],
fc: 21
}, {
lngs: ['he'],
lngs: ['he', 'iw'],
nr: [1, 2, 20, 21],
fc: 22
}];
@@ -2000,11 +2001,11 @@
});
}
if (!this.modules.languageDetector && !this.options.lng) {
if (!this.services.languageDetector && !this.options.lng) {
this.logger.warn('init: no languageDetector is used and no lng is defined');
}
var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
storeApi.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store;
@@ -2012,13 +2013,22 @@
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
};
});
var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
storeApiChained.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store2;
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
return _this2;
};
});
var deferred = defer();
var load = function load() {
_this2.changeLanguage(_this2.options.lng, function (err, t) {
_this2.isInitialized = true;
_this2.logger.log('initialized', _this2.options);
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
_this2.emit('initialized', _this2.options);

File diff suppressed because one or more lines are too long

24
node_modules/i18next/i18next.js generated vendored
View File

@@ -827,7 +827,7 @@
args[_key] = arguments[_key];
}
if (lastKey && lastKey[0] === args[0]) {
if (lastKey && lastKey[0] === args[0] && !options.context) {
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
return null;
@@ -1044,6 +1044,7 @@
key: "getFallbackCodes",
value: function getFallbackCodes(fallbacks, code) {
if (!fallbacks) return [];
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
if (!code) return fallbacks["default"] || [];
@@ -1099,7 +1100,7 @@
nr: [1, 2],
fc: 2
}, {
lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
nr: [1],
fc: 3
}, {
@@ -1179,7 +1180,7 @@
nr: [5, 1, 2, 3],
fc: 21
}, {
lngs: ['he'],
lngs: ['he', 'iw'],
nr: [1, 2, 20, 21],
fc: 22
}];
@@ -2000,11 +2001,11 @@
});
}
if (!this.modules.languageDetector && !this.options.lng) {
if (!this.services.languageDetector && !this.options.lng) {
this.logger.warn('init: no languageDetector is used and no lng is defined');
}
var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
storeApi.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store;
@@ -2012,13 +2013,22 @@
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
};
});
var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
storeApiChained.forEach(function (fcName) {
_this2[fcName] = function () {
var _this2$store2;
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
return _this2;
};
});
var deferred = defer();
var load = function load() {
_this2.changeLanguage(_this2.options.lng, function (err, t) {
_this2.isInitialized = true;
_this2.logger.log('initialized', _this2.options);
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
_this2.emit('initialized', _this2.options);

File diff suppressed because one or more lines are too long

12
node_modules/i18next/index.d.ts generated vendored
View File

@@ -2,7 +2,7 @@ export interface FallbackLngObjList {
[language: string]: string[];
}
export type FallbackLng = string | string[] | FallbackLngObjList;
export type FallbackLng = string | string[] | FallbackLngObjList | ((code:string) => string | string[] | FallbackLngObjList);
export type FormatFunction = (value: any, format?: string, lng?: string) => string;
@@ -205,7 +205,7 @@ export interface InitOptions {
* DEPRECTADED use nonExplicitSupportedLngs
* @default false
*/
nonExplicitWhiteliest?: boolean;
nonExplicitWhitelist?: boolean;
/**
* Array of allowed languages
@@ -1002,12 +1002,12 @@ export interface i18n {
key: string,
value: string,
options?: { keySeparator?: string; silent?: boolean },
): void;
): i18n;
/**
* Adds multiple key/values.
*/
addResources(lng: string, ns: string, resources: any): void;
addResources(lng: string, ns: string, resources: any): i18n;
/**
* Adds a complete bundle.
@@ -1020,7 +1020,7 @@ export interface i18n {
resources: any,
deep?: boolean,
overwrite?: boolean,
): void;
): i18n;
/**
* Checks if a resource bundle exists.
@@ -1035,7 +1035,7 @@ export interface i18n {
/**
* Removes an existing bundle.
*/
removeResourceBundle(lng: string, ns: string): void;
removeResourceBundle(lng: string, ns: string): i18n;
/**
* Current options

22
node_modules/i18next/package.json generated vendored
View File

@@ -1,28 +1,28 @@
{
"_from": "i18next@19.6.2",
"_id": "i18next@19.6.2",
"_from": "i18next@latest",
"_id": "i18next@19.8.2",
"_inBundle": false,
"_integrity": "sha512-Zyd/Z32FY+sD+Eg6sLj5DeDSlrIN3WZ4onuOBRGcjDx/rvodsyUZ9TJ2Y+3aD9Vu8MPbiMU2WesIER/rs1ioyw==",
"_integrity": "sha512-YWqkUpwnmeZxbNxhQ4BENC27BlXnq4kD6NlqMUwX7T6ZN3alNnBXsWrh/8mJ37BL5cKMZaqA0k/YUo4o6rLfpA==",
"_location": "/i18next",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "tag",
"registry": true,
"raw": "i18next@19.6.2",
"raw": "i18next@latest",
"name": "i18next",
"escapedName": "i18next",
"rawSpec": "19.6.2",
"rawSpec": "latest",
"saveSpec": null,
"fetchSpec": "19.6.2"
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/",
"/i18next-scanner"
],
"_resolved": "https://registry.npmjs.org/i18next/-/i18next-19.6.2.tgz",
"_shasum": "859aeba46db0c7cdfa8ae3de7c3a5cad3b0cec83",
"_spec": "i18next@19.6.2",
"_resolved": "https://registry.npmjs.org/i18next/-/i18next-19.8.2.tgz",
"_shasum": "8a20ee098c4702f14aae6dee3ecc39245a6a161e",
"_spec": "i18next@latest",
"_where": "D:\\Projects\\vanillajs-seed",
"author": {
"name": "Jan Mühlemann",
@@ -145,5 +145,5 @@
"test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json"
},
"types": "./index.d.ts",
"version": "19.6.2"
"version": "19.8.2"
}