codeforcroatia / imamopravoznati-theme

Frontend theme for Croatian Alaveteli site
http://imamopravoznati.org
MIT License
1 stars 1 forks source link

Explore Transifex/GitHub integration for automatic translation updates #103

Open schlos opened 3 years ago

schlos commented 3 years ago

Transifex now supports automatic GitHub integration for individual repos: https://docs.transifex.com/transifex-github-integrations/github-tx-ui. We should test this for one of our repos currently using Transifex to see how it might improve our theme translation processes.

Or

We can also choose to send localized content to GitHub manually: https://docs.transifex.com/transifex-github-integrations/github-tx-ui#manual-sync


CONSOLE

See also text management from theme directory: https://docs.transifex.com/client/introduction https://github.com/mysociety/alaveteli/wiki/Generate-theme-translations

schlos commented 3 years ago

Examples: https://github.com/platform-coop-toolkit/coop-library/blob/dev/.github/workflows/main.yml https://github.com/platform-coop-toolkit/coop-library-framework/blob/dev/.github/workflows/main.yml

schlos commented 3 years ago

CONSOLE

Transifex configuration and api key is in "alaveteli" user directory.

sudo su alaveteli cd /var/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme less .tx/config

[main]
file_filter = locale-theme/<lang>/app.po
host = https://www.transifex.com

[imamo-pravo-znati.theme-latest]
file_filter = locale-theme/<lang>/app.po
source_lang = en
source_file = locale-theme/app.pot
type = PO
imamopravoznati-theme/.tx/config (END)

Pull only Croatian translation (for info look at https://docs.transifex.com/client/pull):

tx pull -l hr

in case of errors, force:

tx pull -f

schlos commented 3 years ago

AUTOMATIC TRANSIFEX SYNC TO GITHUB

Configuration page: https://www.transifex.com/code-for-croatia/imamo-pravo-znati/settings/integrations/

Screenshot 2020-10-28 at 22 18 53

Detailed steps: https://docs.transifex.com/transifex-github-integrations/github-tx-ui

Before enabling this:

  1. Move middleware translations to a separate project (or upstream) --> see https://github.com/codeforcroatia/imamopravoznati/issues/85
  2. Remove versioned theme translation files