From af24ba933fd63e33d6f01e16dac1348b8a60bf94 Mon Sep 17 00:00:00 2001 From: Omar Al-Ithawi Date: Thu, 15 Feb 2024 21:07:07 +0300 Subject: [PATCH] feat: remove transifex and hardcoded translations (#728) Refs: FC-0012 OEP-58 --- .tx/config | 8 ------- Makefile | 27 ++++------------------ src/i18n/index.js | 43 ++--------------------------------- src/i18n/messages/ar.json | 1 - src/i18n/messages/ca.json | 1 - src/i18n/messages/es_419.json | 1 - src/i18n/messages/fr.json | 1 - src/i18n/messages/he.json | 1 - src/i18n/messages/id.json | 1 - src/i18n/messages/ko_kr.json | 1 - src/i18n/messages/pl.json | 1 - src/i18n/messages/pt_br.json | 1 - src/i18n/messages/ru.json | 1 - src/i18n/messages/th.json | 1 - src/i18n/messages/uk.json | 1 - src/i18n/messages/zh_CN.json | 1 - 16 files changed, 6 insertions(+), 85 deletions(-) delete mode 100644 .tx/config delete mode 100644 src/i18n/messages/ar.json delete mode 100644 src/i18n/messages/ca.json delete mode 100644 src/i18n/messages/es_419.json delete mode 100644 src/i18n/messages/fr.json delete mode 100644 src/i18n/messages/he.json delete mode 100644 src/i18n/messages/id.json delete mode 100644 src/i18n/messages/ko_kr.json delete mode 100644 src/i18n/messages/pl.json delete mode 100644 src/i18n/messages/pt_br.json delete mode 100644 src/i18n/messages/ru.json delete mode 100644 src/i18n/messages/th.json delete mode 100644 src/i18n/messages/uk.json delete mode 100644 src/i18n/messages/zh_CN.json diff --git a/.tx/config b/.tx/config deleted file mode 100644 index e18191ce..00000000 --- a/.tx/config +++ /dev/null @@ -1,8 +0,0 @@ -[main] -host = https://www.transifex.com - -[o:open-edx:p:edx-platform:r:frontend-template-application] -file_filter = src/i18n/messages/.json -source_file = src/i18n/transifex_input.json -source_lang = en -type = KEYVALUEJSON diff --git a/Makefile b/Makefile index b222c890..d9768def 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -export TRANSIFEX_RESOURCE = frontend-template-application -transifex_langs = "ar,fr,es_419,zh_CN" - intl_imports = ./node_modules/.bin/intl-imports.js transifex_utils = ./node_modules/.bin/transifex-utils.js i18n = ./src/i18n @@ -32,32 +29,16 @@ detect_changed_source_translations: # Checking for changed translations... git diff --exit-code $(i18n) -# Pushes translations to Transifex. You must run make extract_translations first. -push_translations: - # Pushing strings to Transifex... - tx push -s - # Fetching hashes from Transifex... - ./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh - # Writing out comments to file... - $(transifex_utils) $(transifex_temp) --comments --v3-scripts-path - # Pushing comments to Transifex... - ./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 # Pulls translations using atlas. pull_translations: - rm -rf src/i18n/messages mkdir src/i18n/messages cd src/i18n/messages \ - && atlas pull --filter=$(transifex_langs) \ + && atlas pull $(ATLAS_OPTIONS) \ + translations/frontend-platform/src/i18n/messages:frontend-platform \ translations/paragon/src/i18n/messages:paragon \ translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \ translations/frontend-component-header/src/i18n/messages:frontend-component-header \ translations/frontend-template-application/src/i18n/messages:frontend-template-application - $(intl_imports) paragon frontend-component-header frontend-component-footer frontend-template-application -endif + $(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-template-application + diff --git a/src/i18n/index.js b/src/i18n/index.js index 0d6cbb14..a47eb5b0 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -1,41 +1,2 @@ -import { messages as headerMessages } from '@edx/frontend-component-header'; -import { messages as footerMessages } from '@edx/frontend-component-footer'; -import { messages as paragonMessages } from '@openedx/paragon'; - -import arMessages from './messages/ar.json'; -import caMessages from './messages/ca.json'; -// no need to import en messages-- they are in the defaultMessage field -import es419Messages from './messages/es_419.json'; -import frMessages from './messages/fr.json'; -import zhcnMessages from './messages/zh_CN.json'; -import heMessages from './messages/he.json'; -import idMessages from './messages/id.json'; -import kokrMessages from './messages/ko_kr.json'; -import plMessages from './messages/pl.json'; -import ptbrMessages from './messages/pt_br.json'; -import ruMessages from './messages/ru.json'; -import thMessages from './messages/th.json'; -import ukMessages from './messages/uk.json'; - -const appMessages = { - ar: arMessages, - 'es-419': es419Messages, - fr: frMessages, - 'zh-cn': zhcnMessages, - ca: caMessages, - he: heMessages, - id: idMessages, - 'ko-kr': kokrMessages, - pl: plMessages, - 'pt-br': ptbrMessages, - ru: ruMessages, - th: thMessages, - uk: ukMessages, -}; - -export default [ - headerMessages, - footerMessages, - paragonMessages, - appMessages, -]; +// Placeholder be overridden by `make pull_translations` +export default []; diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json deleted file mode 100644 index 0967ef42..00000000 --- a/src/i18n/messages/ar.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/messages/ca.json b/src/i18n/messages/ca.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/ca.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/es_419.json b/src/i18n/messages/es_419.json deleted file mode 100644 index 0967ef42..00000000 --- a/src/i18n/messages/es_419.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json deleted file mode 100644 index 0967ef42..00000000 --- a/src/i18n/messages/fr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/messages/he.json b/src/i18n/messages/he.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/he.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/id.json b/src/i18n/messages/id.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/id.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/ko_kr.json b/src/i18n/messages/ko_kr.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/ko_kr.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/pl.json b/src/i18n/messages/pl.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/pl.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/pt_br.json b/src/i18n/messages/pt_br.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/pt_br.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/ru.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/th.json b/src/i18n/messages/th.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/th.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/uk.json b/src/i18n/messages/uk.json deleted file mode 100644 index 9e26dfee..00000000 --- a/src/i18n/messages/uk.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/i18n/messages/zh_CN.json b/src/i18n/messages/zh_CN.json deleted file mode 100644 index 0967ef42..00000000 --- a/src/i18n/messages/zh_CN.json +++ /dev/null @@ -1 +0,0 @@ -{}