Skip to content

Commit

Permalink
Base multilanguage support (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leshe4ka authored Sep 4, 2023
1 parent fa1b872 commit 5e5960d
Show file tree
Hide file tree
Showing 179 changed files with 3,950 additions and 1,044 deletions.
4 changes: 3 additions & 1 deletion odd-platform-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ yarn-error.log*
.eslintcache

# Generated sources
src/generated-sources
src/generated-sources

/tmp
36 changes: 36 additions & 0 deletions odd-platform-ui/i18next-scanner.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
input: ['./tmp/**/*.{js,jsx}', '!./tmp/**/*.test.{js,jsx}', '!**/node_modules/**'],
output: './',
options: {
removeUnusedKeys: true,
sort: true,
func: {
list: ['i18next.t', 'i18n.t', 't', '__'],
extensions: ['.js', '.jsx'],
},
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
fallbackKey: false,
},
lngs: ['en', 'ja'],
defaultLng: 'en',
defaultValue: '',
resource: {
loadPath: './src/locales/translations/{{lng}}.json',
savePath: './src/locales/translations/{{lng}}.json',
jsonIndent: 2,
lineEnding: '\n',
},
keySeparator: '.',
pluralSeparator: '_',
contextSeparator: '_',
contextDefaultValues: [],
interpolation: {
prefix: '{{',
suffix: '}}',
},
},
};
8 changes: 7 additions & 1 deletion odd-platform-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lint:fix": "eslint --ext .tsx,.ts src/ --fix",
"prepare": "chmod u+x .husky/prepare.sh && .husky/prepare.sh",
"pre-commit": "pnpm tsc --noEmit && lint-staged",
"preinstall": "pnpm install husky && npx only-allow pnpm"
"preinstall": "pnpm install husky && npx only-allow pnpm",
"i18n:scan": "mkdir -p ./tmp && rm -rf ./tmp && npx tsc --jsx preserve --target esnext --module esnext --noEmit false --outDir ./tmp && npx i18next-scanner"
},
"lint-staged": {
"*.{js,ts,jsx,tsx}": [
Expand Down Expand Up @@ -64,13 +65,16 @@
"elkjs": "^0.8.2",
"handlebars": "^4.7.8",
"html-react-parser": "^3.0.16",
"i18next": "^23.2.0",
"i18next-browser-languagedetector": "^7.0.2",
"jotai": "^2.3.1",
"lodash": "^4.17.21",
"query-string": "^8.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.4",
"react-hot-toast": "^2.4.1",
"react-i18next": "^13.0.0",
"react-infinite-scroll-component": "^6.1.0",
"react-multi-date-picker": "^3.3.4",
"react-redux": "^8.1.2",
Expand All @@ -92,6 +96,7 @@
"@types/d3-selection": "^3.0.5",
"@types/d3-shape": "^3.1.1",
"@types/d3-zoom": "^3.0.3",
"@types/glob": "^8.1.0",
"@types/hast": "^2.3.5",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.197",
Expand All @@ -117,6 +122,7 @@
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.3",
"i18next-scanner": "^4.2.0",
"jsdom": "^21.1.2",
"lint-staged": "^13.2.3",
"prettier": "^2.8.8",
Expand Down
Loading

0 comments on commit 5e5960d

Please sign in to comment.