@bigbinary/neeto-commons-frontend 2.1.20 → 2.1.22
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/initializers.cjs.js +14 -1
- package/initializers.cjs.js.map +1 -1
- package/initializers.js +14 -1
- package/initializers.js.map +1 -1
- package/package.json +1 -1
- package/react-utils.d.ts +1 -1
package/initializers.cjs.js
CHANGED
|
@@ -2414,12 +2414,24 @@ var getPackageTranslations = function getPackageTranslations(language, packageNa
|
|
|
2414
2414
|
var allTranslations = packageNames.map(loadTranslations(language));
|
|
2415
2415
|
return ramda.mergeAll(allTranslations);
|
|
2416
2416
|
};
|
|
2417
|
+
var sentenceCasePlaceholderAndTypographyProcessor = {
|
|
2418
|
+
type: "postProcessor",
|
|
2419
|
+
name: "sentenceCasePlaceholderAndTypography",
|
|
2420
|
+
process: function process(value, keys) {
|
|
2421
|
+
if (keys.some(function (str) {
|
|
2422
|
+
return (str.startsWith("placeholder.") || str.startsWith("typography.")) && !str.includes("anyCase.");
|
|
2423
|
+
})) {
|
|
2424
|
+
return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLocaleLowerCase();
|
|
2425
|
+
}
|
|
2426
|
+
return value;
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2417
2429
|
var packageEnTranslations = getPackageTranslations("en", packageNames);
|
|
2418
2430
|
var en = ramda.mergeDeepLeft(commonsEn, packageEnTranslations);
|
|
2419
2431
|
var de = getPackageTranslations("de", packageNames);
|
|
2420
2432
|
var initializeI18n = function initializeI18n(resources) {
|
|
2421
2433
|
var _i18n$services$format;
|
|
2422
|
-
i18n__default["default"].use(Browser).use(reactI18next.initReactI18next).init({
|
|
2434
|
+
i18n__default["default"].use(Browser).use(reactI18next.initReactI18next).use(sentenceCasePlaceholderAndTypographyProcessor).init({
|
|
2423
2435
|
resources: ramda.mergeDeepLeft(resources, {
|
|
2424
2436
|
en: {
|
|
2425
2437
|
translation: en
|
|
@@ -2433,6 +2445,7 @@ var initializeI18n = function initializeI18n(resources) {
|
|
|
2433
2445
|
escapeValue: false,
|
|
2434
2446
|
skipOnVariables: false
|
|
2435
2447
|
},
|
|
2448
|
+
postProcess: ["sentenceCasePlaceholderAndTypography"],
|
|
2436
2449
|
detection: {
|
|
2437
2450
|
order: ["querystring", "cookie", "navigator", "path"],
|
|
2438
2451
|
caches: ["cookie"],
|