@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.js CHANGED
@@ -2405,12 +2405,24 @@ var getPackageTranslations = function getPackageTranslations(language, packageNa
2405
2405
  var allTranslations = packageNames.map(loadTranslations(language));
2406
2406
  return mergeAll(allTranslations);
2407
2407
  };
2408
+ var sentenceCasePlaceholderAndTypographyProcessor = {
2409
+ type: "postProcessor",
2410
+ name: "sentenceCasePlaceholderAndTypography",
2411
+ process: function process(value, keys) {
2412
+ if (keys.some(function (str) {
2413
+ return (str.startsWith("placeholder.") || str.startsWith("typography.")) && !str.includes("anyCase.");
2414
+ })) {
2415
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLocaleLowerCase();
2416
+ }
2417
+ return value;
2418
+ }
2419
+ };
2408
2420
  var packageEnTranslations = getPackageTranslations("en", packageNames);
2409
2421
  var en = mergeDeepLeft(commonsEn, packageEnTranslations);
2410
2422
  var de = getPackageTranslations("de", packageNames);
2411
2423
  var initializeI18n = function initializeI18n(resources) {
2412
2424
  var _i18n$services$format;
2413
- i18n.use(Browser).use(initReactI18next).init({
2425
+ i18n.use(Browser).use(initReactI18next).use(sentenceCasePlaceholderAndTypographyProcessor).init({
2414
2426
  resources: mergeDeepLeft(resources, {
2415
2427
  en: {
2416
2428
  translation: en
@@ -2424,6 +2436,7 @@ var initializeI18n = function initializeI18n(resources) {
2424
2436
  escapeValue: false,
2425
2437
  skipOnVariables: false
2426
2438
  },
2439
+ postProcess: ["sentenceCasePlaceholderAndTypography"],
2427
2440
  detection: {
2428
2441
  order: ["querystring", "cookie", "navigator", "path"],
2429
2442
  caches: ["cookie"],