forked from openedx/frontend-component-footer
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
5,566 additions
and
5,500 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ temp | |
.idea/ | ||
|
||
src/i18n/transifex_input.json | ||
temp/babel-plugin-react-intl |
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,41 +1,46 @@ | ||
transifex_resource = frontend-component-footer | ||
transifex_langs = "ar,fr,es_419,zh_CN" | ||
transifex_utils = ./node_modules/.bin/transifex-utils.js | ||
transifex_input = ./src/i18n/transifex_input.json | ||
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/ | ||
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/ | ||
|
||
# this directory must match .babelrc | ||
transifex_temp = ./temp/babel-plugin-react-intl | ||
|
||
requirements: | ||
npm install | ||
|
||
i18n.extract: | ||
# Pulling display strings from .jsx files into .json files... | ||
# Pulling display strings from .jsx files into .json files... | ||
rm -rf $(transifex_temp) | ||
npm run-script i18n_extract | ||
|
||
i18n.concat: | ||
# Gathering JSON messages into one file... | ||
./src/i18n/i18n-concat.js ./temp/src ./src/i18n/transifex_input.json | ||
|
||
|
||
# The following make targets are required by our tooling scripts found in: | ||
# - https://github.com/edx/ecommerce-scripts/tree/master/transifex | ||
# Gathering JSON messages into one file... | ||
$(transifex_utils) $(transifex_temp) $(transifex_input) | ||
|
||
extract_translations: | requirements i18n.extract i18n.concat | ||
|
||
detect_changed_source_translations: | ||
git diff --exit-code ./src/i18n/transifex_input.json | ||
# Checking for changed translations... | ||
git diff --exit-code $(transifex_input) | ||
|
||
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/frontend-component-footer/translation/en/strings/ | ||
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/frontend-component-footer/source/ | ||
validate-no-uncommitted-package-lock-changes: | ||
# Checking for package-lock.json changes... | ||
git diff --exit-code package-lock.json | ||
|
||
# push translations to Transifex, doing magic so we can include the translator comments | ||
# Note: extract_translations is a prereq that our translation script calls separately. | ||
# Push translations to Transifex. Run make extract_translations first. | ||
push_translations: | ||
# Pushing strings to Transifex... | ||
tx push -s | ||
# Adding translator comments... | ||
# Fetching strings from Transifex... | ||
# Fetching hashes from Transifex... | ||
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1) | ||
# Writing out comments to file... | ||
./src/i18n/i18n-concat.js ./temp/src --comments | ||
# Adding comments to Transifex... | ||
# Writing out comments to file... | ||
$(transifex_utils) $(transifex_temp) --comments | ||
# Pushing comments to Transifex... | ||
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2) | ||
|
||
# pull translations from Transifex | ||
pull_translations: ## must be exactly this name for edx tooling support, see ecommerce-scripts/transifex/pull.py | ||
tx pull -f --mode reviewed --language="ar,fr,es_419,zh_CN" | ||
|
||
validate-no-uncommitted-package-lock-changes: | ||
git diff --exit-code package-lock.json | ||
# Pull translations from Transifex | ||
pull_translations: | ||
tx pull -f --mode reviewed --language=$(transifex_langs) |
Oops, something went wrong.