Page tree
Skip to end of metadata
Go to start of metadata

We translate midPoint on Transifex.


Table of Contents:

Command-line client

See: http://docs.transifex.com/client/setup/

then:

tx init

Press Enter on Transifex instance and then supply Transifex's username + password.

Configuration

Transifex configuration is in the .tx subdirectory of the root source code directory. It was created like this:

tx set --auto-local --type PROPERTIES --source-lang en -r midpoint.admin-gui 'gui/admin-gui/src/main/resources/localization/Midpoint_<lang>.properties' --source-file gui/admin-gui/src/main/resources/localization/Midpoint.properties --execute

Initial push:

tx push -s -t -f


Data synchronization

Status

tx status

Pull

tx pull -a

Push

tx push -s -t

Transifex and midPoint Git

There is a dedicated reposiutory for localization and translations: midpoint-localization. Main midpoint repository depends on this one.

From transifex to midPoint git

This needs to be done if there are new tranlations on transifex.

git pull

# pull translations from transifex
tx pull -fa

#since source properties is English, we need to get English translation as en_US
#and then, rename en_US to en
rm localization\Midpoint_en.properties 
mv localization\Midpoint_en_US.properties localization\Midpoint_en.properties 
rm localization\schema_en.properties 
mv localization\schema_en_US.properties localization\schema_en.properties  

# check that the pulled translations are roughly OK
git diff

# make sure to mention all the contributors in the commit message (see transifex timeline)
git commit -a
git push

After that, translations are pulled from transifex into master branch in git, and then pushed back.

There is no exact rule when this should happen, so until we automate this, it is recommended to pull new translations regularly or after frequent translations.

From midPoint git to transifex

This needs to be done if source file (midpoint.properties) changes, e.g. if there are new translation keys.

There is no manual steps, transifex is configured (how-to) to pull sources automatically from raw properties files (midPoint.properties and schema.properties). This happens once a day, typically around 12:00 UTC.

  • New keys and values for translations are added
  • Changed keys and/or values are added as new one, translations of old strings are lost.
    • But with transifex "suggestions" based on previous translations, this is not big issue.
    • This works even when only values are changed, which is needed in time when the terminology has changed.

Future

Manual step for pulling translations is the main drawback of this solution.

There is a project called txgh, written in Ruby, that solves both-directional sync between Github and Transifex.

  • It needs to be run somewhere on a server, instructions are given for Ubuntu and Amazon AWS EC2.
  • It is recommended by Transifex.

This project works using webhooks on github and Transifex. Default behaviour is:

  • It checks changes on github and pushes source to transifex
  • Once translation is 100% done, it is pulled back.
  • It operates over one specified branch in git (we need two branches right now, master and transifex)


  • No labels