-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: generate currentlySupportedLangs.jsx dynamically
instead of hardcoded `transifex_langs = "ar,fr,es_419,zh_CN"` now it generates the file based on the `atlas pull` result
- Loading branch information
1 parent
fd5375f
commit 84e832f
Showing
4 changed files
with
31 additions
and
43 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 |
---|---|---|
@@ -1,28 +1,16 @@ | ||
// This file is generated by the "i18n/scripts/generateSupportedLangs.js" script. | ||
import arData from 'react-intl/locale-data/ar'; | ||
import enData from 'react-intl/locale-data/en'; | ||
import esData from 'react-intl/locale-data/es'; | ||
import frData from 'react-intl/locale-data/fr'; | ||
import zhData from 'react-intl/locale-data/zh'; | ||
|
||
import './ar.json'; | ||
import esData from 'react-intl/locale-data/es'; | ||
import './es_419.json'; | ||
import frData from 'react-intl/locale-data/fr'; | ||
import './fr.json'; | ||
import zhData from 'react-intl/locale-data/zh'; | ||
import './zh_CN.json'; | ||
|
||
// Methodology: These languages (plus the default english) are the only ones that appear on edx.org | ||
// This was determined by inspecting the 'released_languages' method in the following file: | ||
// https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/lang_pref/api.py | ||
// | ||
// Further, I hit the read replica in order to confirm the live values, which are currently: | ||
// en, fr, zh-cn, es-419, ar | ||
// If these values change, please also update the pull_translations command in Makefile | ||
|
||
const localeDataMap = { | ||
export default { | ||
'ar': arData, | ||
'en': enData, | ||
'es-419': esData, | ||
'fr': frData, | ||
'zh-cn': zhData, | ||
}; | ||
|
||
export default localeDataMap; |
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