|
1 | 1 | UNAME := $(shell uname) |
| 2 | + |
| 3 | +i18n = ./src/data/i18n/default |
| 4 | +transifex_input = $(i18n)/transifex_input.json |
| 5 | + |
| 6 | +# This directory must match .babelrc . |
| 7 | +transifex_temp = ./temp/babel-plugin-react-intl |
| 8 | + |
2 | 9 | export TRANSIFEX_RESOURCE = studio-frontend |
3 | 10 |
|
4 | 11 | # Help message borrowed from https://github.com/edx/devstack, which borrowed it from https://github.com/pydanny/cookiecutter-djangopackage. |
@@ -28,6 +35,9 @@ down: ## stop and remove studio-frontend container |
28 | 35 | stop: ## stops studio-frontend container |
29 | 36 | docker-compose stop |
30 | 37 |
|
| 38 | +requirements: |
| 39 | + npm install |
| 40 | + |
31 | 41 | npm-install-%: ## install specified % npm package on the studio-frontend container |
32 | 42 | docker exec dahlia.studio-frontend npm install $* --save-dev |
33 | 43 | git add package.json |
@@ -55,27 +65,27 @@ asset-page-flag: ## insert a waffle flag into local docker devstack |
55 | 65 | i18n.docker: ## what devs should do from their host machines |
56 | 66 | docker exec -t dahlia.studio-frontend bash -c 'make i18n.extract && make i18n.preprocess' |
57 | 67 |
|
58 | | -extract_translations: ## no prerequisites so we can control order of operations |
59 | | - echo "We have to define this target due to tooling assumptions" |
60 | | - echo "Also we have to npm install using this hook b/c there's no other place for it in the current setup" |
61 | | - npm install |
62 | | - npm run-script i18n_extract |
| 68 | +extract_translations: | requirements i18n.extract i18n.preprocess |
63 | 69 |
|
64 | 70 | i18n.extract: ## move display strings from displayMessages.jsx to displayMessages.json |
65 | 71 | npm run-script i18n_extract |
66 | 72 |
|
67 | 73 | i18n.preprocess: ## gather all display strings into a single file |
68 | | - $$(npm bin)/reactifex ./src/data/i18n/default/src/components/ ./src/data/i18n/default/transifex_input.json |
| 74 | + $$(npm bin)/edx_reactifex $(transifex_temp) $(transifex_input) |
69 | 75 |
|
70 | 76 | i18n.pre_validate: | i18n.extract i18n.preprocess |
71 | 77 | git diff --exit-code ./src/data/i18n/default/transifex_input.json |
72 | 78 |
|
73 | 79 | tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/studio-frontend/translation/en/strings/ |
74 | 80 | tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/studio-frontend/source/ |
75 | | -push_translations: | i18n.extract |
76 | | - # Transifex is set up to watch transifex_input.json, but that filetype lacks comments |
| 81 | +# Pushes translations to Transifex. You must run make extract_translations first. |
| 82 | +push_translations: |
| 83 | + |
| 84 | + # # Pushing strings to Transifex... |
| 85 | + tx push -s |
| 86 | + |
77 | 87 | ./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh |
78 | | - $$(npm bin)/edx_reactifex ./src/data/i18n/default --comments --v3-scripts-path |
| 88 | + $$(npm bin)/edx_reactifex $(transifex_temp) --comments --v3-scripts-path |
79 | 89 | ./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh |
80 | 90 |
|
81 | 91 | pull_translations: ## must be exactly this name for edx tooling support, see ecommerce-scripts/transifex/pull.py |
|
0 commit comments