| 1 | [[TOC]] |
| 2 | = Set up a local Transifex repository HOWTO = |
| 3 | |
| 4 | == About this document == |
| 5 | |
| 6 | This document is intended to all translators and the release masters who will be deal with translations for Midnight Commander (also applicable for all other projects who use services of [http://www.transifex.com Transifex] project). |
| 7 | |
| 8 | == About Transifex == |
| 9 | |
| 10 | [http://www.transifex.com Transifex] is a modern, open-source localization platform. It’s a web system which automates the translation workflow for complex international projects. |
| 11 | |
| 12 | [http://www.transifex.com Transifex] seamlessly integrates with existing content infrastructure, such as a software development repository or content management system, using a rich API. Translation is "crowd-sourced" to a global network of human translators using smart and agile translation techniques adopted from the open source ecosystem. |
| 13 | |
| 14 | == Getting Transifex client == |
| 15 | |
| 16 | === Getting from sources === |
| 17 | |
| 18 | You can download the repository either using git: |
| 19 | {{{ |
| 20 | git clone git://github.com/transifex/transifex-client.git |
| 21 | }}} |
| 22 | or you can directly download from the [http://code.transifex.com/transifex-client/downloads repository web-page]. |
| 23 | |
| 24 | To install it, run follow commands: |
| 25 | {{{ |
| 26 | $ cd transifex-client |
| 27 | $ sudo python setup.py install |
| 28 | }}} |
| 29 | |
| 30 | === Getting binary files === |
| 31 | ==== Common distributive ==== |
| 32 | {{{ |
| 33 | $ sudo easy_install --upgrade transifex-client |
| 34 | }}} |
| 35 | ==== Fedora ==== |
| 36 | {{{ |
| 37 | $ sudo yum install transifex-client |
| 38 | }}} |
| 39 | |
| 40 | == Using Transifex client == |
| 41 | To make sure that transifex-client was installed correctly, try running it with the following command: |
| 42 | {{{ |
| 43 | tx --help |
| 44 | }}} |
| 45 | If everything is okay, then you should see a help message and basic instructions. To get more information for each command of tool you can use |
| 46 | {{{ |
| 47 | tx help <command> |
| 48 | }}} |
| 49 | === tx-repository initialization === |
| 50 | |
| 51 | We have two main branches: master and *-stable. These branches may be different by features (and by translated strings too), therefore we have a different pot-resources on [http://www.transifex.com Transifex]. Transifex client uses mapping to local files as one directory per tx-resource, but git-repository provide several branches in one directory therefore I suggest to separate TX-repo and GIT-repo in different directories. We'll mark these directories as $TX_REPO and $GIT_REPO. |
| 52 | |
| 53 | Run follow commands: |
| 54 | |
| 55 | {{{ |
| 56 | $ mkdir $TX_REPO |
| 57 | $ cd $TX_REPO |
| 58 | $ tx init |
| 59 | Creating .tx folder... |
| 60 | Transifex instance [https://www.transifex.net]: |
| 61 | Creating skeleton... |
| 62 | Creating config file... |
| 63 | $ |
| 64 | }}} |
| 65 | |
| 66 | Add local mapping for pot-resources: |
| 67 | {{{ |
| 68 | cat >>$TX_REPO/.tx/config <<EOF |
| 69 | |
| 70 | [mc.mcpot] |
| 71 | file_filter = master/<lang>.po |
| 72 | source_file = master/mc.pot |
| 73 | source_lang = en |
| 74 | |
| 75 | [mc.mcpot-stable] |
| 76 | file_filter = stable/<lang>.po |
| 77 | source_file = stable/mc.pot |
| 78 | source_lang = en |
| 79 | EOF |
| 80 | }}} |
| 81 | |
| 82 | Fetch all translations by commend: |
| 83 | {{{ |
| 84 | tx pull --all |
| 85 | }}} |
| 86 | |
| 87 | Now you are ready to fetch translations before any release (as this described on ReleaseGuidelines page). |