Repository navigation
chore: migrate to new localization process #4910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
010b793
8fcc218
ebe2088
5e7c7ad
a059426
66657e3
9b3f370
66d6e2f
692dd7b
5cb32ac
37561f1
91352be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ dist/ | |
| es/ | ||
| i18n/*.js | ||
| i18n/bundles/ | ||
| i18n/json/ | ||
| node_modules/ | ||
| reports/ | ||
| storybook/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,6 @@ desktop.ini | |
| examples | ||
| flow/ | ||
| flow-typed/npm/ | ||
| i18n/json | ||
| jest.config.js | ||
| jsconfig.json | ||
| npm-debug.log | ||
|
|
||
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // THIS IS A GENERATED FILE. DO NOT EDIT MANUALLY OR YOUR CHANGES WILL BE OVERWRITTEN | ||
| export default {}; |
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // THIS FILE IS INTENTIONALLY LEFT BLANK. | ||
| // Messages for the source locale are loaded from message definitions via react-intl fallback. | ||
| // DO NOT ADD ANY MESSAGES HERE! | ||
| export default {}; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // THIS IS A GENERATED FILE. DO NOT EDIT MANUALLY OR YOUR CHANGES WILL BE OVERWRITTEN | ||
| export default {}; |
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,39 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| // Remove this file and call buildBundles from @box/frontend directly when @box/frontend is upgraded to ^12. | ||
|
|
||
| /** | ||
| * buildLanguages.js - Generate i18n bundle files | ||
| * | ||
| * This script replaces the bundle generation that was previously done | ||
| * by TranslationsPlugin during webpack builds. | ||
| * | ||
| * Usage: buildLanguages.js [i18nDir] [--typescript] | ||
| */ | ||
|
|
||
| const path = require('path'); | ||
| const buildLanguageBundles = require('@box/frontend/i18n/buildLanguageBundles'); | ||
| const buildTranslations = require('@box/frontend/i18n/buildTranslations'); | ||
| const { translationDependencies } = require('./i18n.config'); | ||
|
|
||
| buildTranslations(); | ||
| buildLanguageBundles(translationDependencies.map(pkg => `${pkg}/i18n/[language]`)); | ||
| // Parse command-line arguments | ||
| // Usage: buildLanguages.js [i18nDir] [--typescript] | ||
| const args = process.argv.slice(2); | ||
| const typescript = args.includes('--typescript'); | ||
|
|
||
| const i18nDir = args.find(arg => !arg.startsWith('--')); | ||
| const options = { | ||
| i18nDir, | ||
| typescript, | ||
| }; | ||
|
|
||
| // Load translation dependencies from i18n.config.js in the project root | ||
| const projectRootDir = process.cwd(); | ||
| const configPath = path.join(projectRootDir, 'i18n.config.js'); | ||
| // eslint-disable-next-line import/no-dynamic-require | ||
| const { translationDependencies } = require(configPath); | ||
|
|
||
| // Transform package names to i18n paths with [language] placeholder | ||
| // Use the folder name from i18nDir if provided, otherwise default to 'i18n' | ||
| const i18nFolderName = i18nDir ? path.basename(i18nDir) : 'i18n'; | ||
| const additionalMessageData = translationDependencies.map(pkg => `${pkg}/${i18nFolderName}/[language]`); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| buildLanguageBundles(additionalMessageData, options); | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.