-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(storybook): Enabled intl feature in storybook (#3649)
* chore(storybook): Added global types for storybook * chore(storybook): Enabled intl feature in storybook
- Loading branch information
1 parent
297fabf
commit b3d2d58
Showing
9 changed files
with
64 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ dist | |
es | ||
i18n/*.js | ||
i18n/json | ||
i18n/bundles | ||
node_modules | ||
npm-debug.log | ||
npm-error.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
import enUS from '../i18n/en-US'; | ||
import deDE from '../i18n/de-DE'; | ||
import frFR from '../i18n/fr-FR'; | ||
import jaJP from '../i18n/ja-JP'; | ||
import zhCN from '../i18n/zh-CN'; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const boxLanguages = require('@box/languages'); | ||
|
||
const locales = ['en', 'de', 'fr', 'jp', 'zh']; | ||
|
||
const messages = { | ||
'en': { ...enUS }, | ||
'de': { ...deDE }, | ||
'fr': { ...frFR }, | ||
'jp': { ...jaJP }, | ||
'zh': { ...zhCN }, | ||
}; | ||
const messages = boxLanguages.reduce( | ||
(acc, lang) => ({ | ||
...acc, | ||
// eslint-disable-next-line global-require,import/no-dynamic-require,@typescript-eslint/no-var-requires | ||
[lang]: require(`../i18n/bundles/${lang}`).messages, // whatever the relative path to your messages json is | ||
}), | ||
{}, | ||
); | ||
|
||
export const reactIntl = { | ||
defaultLocale: 'en', | ||
locales, | ||
defaultLocale: 'en-US', | ||
messages, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
// packages to bundle into translation files | ||
translationDependencies: ['@box/box-ai-content-answers'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters