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 17, 2024
1 parent 94aeaff commit d88ee9a
Show file tree
Hide file tree
Showing 22 changed files with 6 additions and 351 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ temp/babel-plugin-react-intl
### Local dev related ###
.env.private
module.config.js

src/i18n/messages
9 changes: 0 additions & 9 deletions .tx/config

This file was deleted.

27 changes: 3 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
transifex_resource = frontend-app-support
transifex_langs = "ar,fr,es_419,zh_CN,fr_CA,it_IT,pt_PT,de_DE,uk,ru,hi"

intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
i18n = ./src/i18n
Expand All @@ -9,7 +6,6 @@ transifex_input = $(i18n)/transifex_input.json
# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-formatjs

export TRANSIFEX_RESOURCE=frontend-app-support

precommit:
npm run lint
Expand All @@ -34,36 +30,19 @@ 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
# Experimental: OEP-58 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/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-app-support-tools/src/i18n/messages:frontend-app-support-tools

$(intl_imports) frontend-component-header frontend-component-footer paragon frontend-app-support-tools
endif
$(intl_imports) frontend-platform frontend-component-header frontend-component-footer paragon frontend-app-support-tools

# This target is used by CI.
validate-no-uncommitted-package-lock-changes:
Expand Down
48 changes: 1 addition & 47 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
@@ -1,47 +1 @@
import { messages as paragonMessages } from '@edx/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';
import dedeMessages from './messages/de_DE.json';
import frcaMessages from './messages/fr_CA.json';
import hiMessages from './messages/hi.json';
import ititMessages from './messages/it_IT.json';
import ptptMessages from './messages/pt_PT.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,
'de-de': dedeMessages,
'fr-ca': frcaMessages,
hi: hiMessages,
'it-it': ititMessages,
'pt-pt': ptptMessages,
};

export default [
paragonMessages,
appMessages,
];
export default [];
24 changes: 0 additions & 24 deletions src/i18n/messages/ar.json

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/de_DE.json

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/es_419.json

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/fr_CA.json

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/hi.json

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/it_IT.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.

24 changes: 0 additions & 24 deletions src/i18n/messages/pt_PT.json

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions src/i18n/messages/ru.json

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit d88ee9a

Please sign in to comment.