Skip to content

Commit

Permalink
feat!: remove Transifex calls for OEP-58
Browse files Browse the repository at this point in the history
  • Loading branch information
hopewise authored and OmarIthawi committed Mar 16, 2024
1 parent 500ae54 commit 2039041
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 924 deletions.
8 changes: 0 additions & 8 deletions .tx/config

This file was deleted.

23 changes: 1 addition & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
UNAME := $(shell uname)

transifex_langs = "ar,fr,es_419,zh_CN"
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json
i18n = ./src/i18
transifex_utils = ./node_modules/.bin/edx_reactifex

# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl

export TRANSIFEX_RESOURCE = studio-frontend

# Help message borrowed from https://github.com/openedx/devstack, which borrowed it from https://github.com/pydanny/cookiecutter-djangopackage.
help: ## display a help message
@echo $(MAKEFILE_LIST)
Expand Down Expand Up @@ -81,29 +78,11 @@ i18n.concat:
i18n.pre_validate: | i18n.extract i18n.concat
git diff --exit-code $(transifex_input)

# Pushes translations to Transifex. You must run make extract_translations first.
push_translations:

# # Pushing strings to Transifex...
tx push -s

./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh
$$(npm bin)/edx_reactifex $(transifex_temp) --comments --v3-scripts-path
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh


ifeq ($(OPENEDX_ATLAS_PULL),)
# Pulls translations from Transifex.
pull_translations:
tx pull -t -f --mode reviewed --languages=$(transifex_langs)
else
# Experimental: OEP-58 Pulls translations using atlas
pull_translations:
rm -rf src/i18n/messages
cd src/i18n/ \
&& atlas pull $(ATLAS_OPTIONS) translations/studio-frontend/src/i18n/messages:messages
node src/utils/i18n/scripts/generateSupportedLangs.js src/i18n/messages
endif

copy-dist:
for f in dist/*; do docker cp $$f edx.devstack.studio:/edx/app/edxapp/edx-platform/node_modules/@edx/studio-frontend/dist/; done
1 change: 0 additions & 1 deletion src/data/i18n/locales

This file was deleted.

176 changes: 0 additions & 176 deletions src/i18n/messages/ar.json

This file was deleted.

15 changes: 2 additions & 13 deletions src/i18n/messages/currentlySupportedLangs.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
// Legacy of the old i18n system, should be replaced with a proper MFE with `frontend-platform` i18n support

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 './es_419.json';
import './fr.json';
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 = {
'ar': arData,
'en': enData,
Expand Down
176 changes: 0 additions & 176 deletions src/i18n/messages/es_419.json

This file was deleted.

176 changes: 0 additions & 176 deletions src/i18n/messages/fr.json

This file was deleted.

176 changes: 0 additions & 176 deletions src/i18n/messages/zh_CN.json

This file was deleted.

Loading

0 comments on commit 2039041

Please sign in to comment.