Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 3.64 KB

tx.md

File metadata and controls

73 lines (54 loc) · 3.64 KB

TX: mope tx <target>

Synopsis

$ mope tx [push|pull]

push

(e.g. mope tx push): Pushes new and updated content to Transifex for translation

pull

(e.g. mope tx pull <resource>): Pulls translated content from Transifex resource and appends to po files

Options

Note: These options are only available for push right now.

--project

(e.g. mope tx push --project=master): Pushes translated content from local repo into Transifex master resource

--all

(e.g. mope tx push --all): Pushes translated content from local repo into Transifex all_translations resource

Transifex process / flow

Transifex is used to translate our content. Each step in the process is an interaction between Transifex and the codebase. We use .po files to store trn content locally and on Transifex.

Architecture diagram

  • push - Each time a PR is created or updated a Transifex resource (named after the branch) is created or updated, assuming trn content is created or changed. This is run via Travis.

    push parses the codebase, extracting trn content with babel-plugin-react-intl. It loads content from the ${txProject}-master transifex project which is used as a point of comparison for a diff. The results of the diff (if any) are put in a new resource in mup-web on transifex.

  • push --project=master - Updates the master resource - the canonical copy of translated content. The main usage is for diffing against when examining a new / updated PR. This is run whenever there's an update to the master branch. This pushes all languages.

  • push --all - Updates the all_translations resource - the editable copy of all translations content in a given repo. The main usage is for updating translation content through Transifex without developer intervention. This is run whenever there's an update to the master branch, so it is always in sync with master.

  • pull <resource>- should be run while on a fresh branch from master, separate from other code changes. It will download translated content from the current project's resources in order of most-recently-updated. Merges pulled content into src/trns/po/{localeCode}.po files. Run for each resource you wish to pull down, usually resources where translation is complete. Commit result, create PR, and merge PR after Travis build has passed.

  • pullAll- should be run while on a fresh branch from master, separate from other code changes. It will download translated content from all resources for the project it is run in in last updated resource order. As each resource is pulled, and then merges pulled content into the associated by locale src/trns/po/{localeCode}.po files.

    • If you'd like to have a history of each change based on resource add a flag of -c and it will create a unique commit for each resource that has a change to commit.
    • Please note that if your project has a all_translations resource for translators to be able to edit any key that is in the master project, this resource will be pulled first then all other resources will be downloaded after and applied on top of it.

    Commit result, create PR, and merge PR after Travis build has passed.

  • Adding new locales / languages - First make sure that the language has been added to the project in Transifex. Create a new .po file in src/trns/po, copying the first three lines (headers) from another .po file. Add the locale to src/util/locales.js and https://github.com/meetup/meetup-web-platform/blob/master/src/util/localizationUtils.js