Skip to content

Commit

Permalink
feat: remove transifex and hardcoded translations (#728)
Browse files Browse the repository at this point in the history
Refs: FC-0012 OEP-58
  • Loading branch information
OmarIthawi authored Feb 15, 2024
1 parent f49750c commit af24ba9
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 85 deletions.
8 changes: 0 additions & 8 deletions .tx/config

This file was deleted.

27 changes: 4 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

43 changes: 2 additions & 41 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
@@ -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 [];
1 change: 0 additions & 1 deletion src/i18n/messages/ar.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/ca.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/es_419.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/fr.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/he.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/id.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/ko_kr.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/pl.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/pt_br.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/ru.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/th.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/uk.json

This file was deleted.

1 change: 0 additions & 1 deletion src/i18n/messages/zh_CN.json

This file was deleted.

0 comments on commit af24ba9

Please sign in to comment.