|
29 | 29 | .pot and .po files to a given Transifex account, and detects translations done |
30 | 30 | on Transifex and dump back on Github. |
31 | 31 |
|
32 | | -**NOTE**: This requires a library to handle Transifex API that can be found |
33 | | -in https://github.com/transifex/transifex-python-library, and a library for |
34 | | -Github API that can be downloaded using *pip install PyGithub*. |
| 32 | +Installation |
| 33 | +============ |
35 | 34 |
|
36 | | -**Known issues**: |
| 35 | +This module requires two external libraries: |
37 | 36 |
|
38 | | -* If you check first Transifex updates before Github, it will be produce |
| 37 | +* txlib to handle Transifex API available at |
| 38 | +https://github.com/transifex/transifex-python-library |
| 39 | +* pygithub for Github API that can be downloaded using *pip install PyGithub*. |
| 40 | +
|
| 41 | +Configuration |
| 42 | +============= |
| 43 | +
|
| 44 | +* In Transbot > Configuration |
| 45 | +
|
| 46 | +Transifex |
| 47 | +--------- |
| 48 | +
|
| 49 | +* Configure a user and a password for Transifex. This cannot be done via |
| 50 | +a token, because Transifex doesn't allow this option. This data is stored |
| 51 | +as system parameters, so password is going to be in plain text, although |
| 52 | +in the configuration screen appears masked. |
| 53 | +* Make sure to create a password authenticated user and not a oauth |
| 54 | +authenticated user (Linkedin, Github, Facebook). |
| 55 | +* Configure a Transifex organization and team. Team is identified by a slug |
| 56 | +or name, derived from the real name you have put. The translation group is |
| 57 | +an id (number) that can be seen in the URL when you are on it on the web page. |
| 58 | +* The Transifex translation group must have added the corresponding languages |
| 59 | +that can be synchronized with Github, or you will get an error on contrary. |
| 60 | +
|
| 61 | +Github |
| 62 | +------ |
| 63 | +
|
| 64 | +* You have to issue a new token for the user you want to interact with on |
| 65 | +Github, with all the permissions granted, and put on the corresponding field |
| 66 | +on the configuration. |
| 67 | +* Last, you have to create a Github project record for each of the repos, |
| 68 | +putting the organization of the repo and the project name in it. There is no |
| 69 | +support for now for personal repos, only organization repos, but it's very |
| 70 | +easy to create an organization for you only. |
| 71 | +
|
| 72 | +Transbot |
| 73 | +-------- |
| 74 | +
|
| 75 | +* Create a Github project and click on Get branches to retrieve current |
| 76 | +branches. You can deactivate any branch you don't want in the list |
| 77 | +(for example, dev branches). |
| 78 | +* Then, you can click on Check Github updates to query active branches of |
| 79 | +the current Transbot project for new files, creating a Transifex project for |
| 80 | +each branch with this convention: <project_name> (<branch_name>), and |
| 81 | +uploading pot and po files. Here there can be errors that are logged |
| 82 | +(for example, an empty translation file like fr_BE.po in vertical-hotel). |
| 83 | +* After this, you can click also on Check Transifex updates, which detects |
| 84 | +possible changes on translation strings on Transifex, and dump back on Github. |
| 85 | +This is awfully slow, but there's no other way, because it has to download |
| 86 | +each set of translation strings and check against saved hash, because |
| 87 | +Transifex doesn't provide any other method. |
| 88 | +* There are 2 crons that can be changed for automatic check of both sides. |
| 89 | +
|
| 90 | +Known issues |
| 91 | +============ |
| 92 | +
|
| 93 | +* If you check Transifex updates before Github, it will be produce |
39 | 94 | an inconsistent behaviour or even an error. |
40 | 95 | * Not all communications exceptions with APIs are caught and registered |
41 | 96 | on log for now, so you can have that cron process halts silently, so please |
|
47 | 102 | 'base', |
48 | 103 | ], |
49 | 104 | 'external_dependencies': { |
50 | | - 'python': ['github'], # 'txlib'], |
| 105 | + 'python': ['github', 'txlib'], |
51 | 106 | }, |
52 | 107 | 'data': [ |
53 | 108 | 'data/ir_cron.xml', |
|
0 commit comments