MM-51975 : Standardise Formatjs config for Playbooks & Boards (#22948)

Added Formatjs's built-in formatter called "simple". With this change, the intermediate Formatjs compile step is removed. Additionally, the npm command for Playbooks was standardised by replacing "extract" with "i18n-extract" to ensure consistency across all products.
Этот коммит содержится в:
M-ZubairAhmed
2023-04-16 13:23:36 +05:30
коммит произвёл GitHub
родитель 2119bc0901
Коммит 5c8880321f
4 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@@ -453,4 +453,4 @@
"tutorial_tip.ok": "Next",
"tutorial_tip.out": "Opt out of these tips.",
"tutorial_tip.seen": "Seen this before?"
}
}

Просмотреть файл

@@ -4,7 +4,6 @@
"private": true,
"description": "",
"scripts": {
"i18n-extract": "formatjs extract \"src/**/*.{ts,tsx}\" --ignore \"**/*.d.ts\" --out-file i18n/tmp.json && formatjs compile i18n/tmp.json --out-file i18n/en.json && npx rimraf i18n/tmp.json",
"build": "webpack --mode=production",
"build:watch": "webpack --mode=production --watch",
"start:product": "webpack serve --mode=development",
@@ -18,6 +17,7 @@
"check-types": "tsc -b",
"check-types:fix": "npm run check-types -- --noEmit --fix",
"check": "npm run check-lint && npm run check-style",
"i18n-extract": "formatjs extract \"src/**/*.{ts,tsx}\" --ignore \"**/*.d.ts\" --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple --out-file i18n/en.json",
"fix": "npm run check-lint:fix && npm run check-style:fix",
"test": "cross-env TZ=Etc/UTC jest",
"test:watch": "cross-env TZ=Etc/UTC jest --watch",

Просмотреть файл

@@ -607,4 +607,4 @@
"zx0myy": "Participants",
"zxj2Gh": "Last updated {time}",
"zz6ObK": "Restore"
}
}

Просмотреть файл

@@ -124,7 +124,7 @@
"test:debug": "cross-env TZ=Etc/UTC jest --forceExit --detectOpenHandles --verbose",
"test-ci": "cross-env TZ=Etc/UTC jest --ci --maxWorkers=100%",
"check-types": "tsc -b",
"extract": "formatjs extract 'src/**/*.{ts,tsx}' --ignore \"**/*.d.ts\" --out-file i18n/temp.json --id-interpolation-pattern '[sha512:contenthash:base64:6]' && formatjs compile 'i18n/temp.json' --out-file i18n/en.json && rm i18n/temp.json",
"i18n-extract": "formatjs extract \"src/**/*.{ts,tsx}\" --ignore \"**/*.d.ts\" --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple --out-file i18n/en.json",
"graphql": "graphql-codegen --config graphql_gen.ts",
"report-unused-exports": "ts-prune",
"build:product": "webpack --mode=production",