Search 1.9 billion lines of Odoo code on GitHub

transbot

Author: Serv. Tecnolog. Avanzados - Pedro M. Baeza
License: no license
Branch: 8.0-transbot
Repository: pedrobaeza/server-tools
Dependencies: base
Languages: Python (619, 57.3%), SVG (237, 21.9%), XML (165, 15.3%), and reStructuredText (59, 5.5%)

<a name="transbot-oca-tool-for-managing-translations"></a> <h2>Transbot: OCA tool for managing translations</h2> <p>This module enables a bot that checks selected Github branches and dump .pot and .po files to a given Transifex account, and detects translations done on Transifex and dump back on Github.</p> <a name="installation"></a> <h2>Installation</h2> <p>This module requires two external libraries:</p> <ul class="simple"> <li>txlib to handle Transifex API available at</li> </ul> <p><a class="reference external" href="https://github.com/transifex/transifex-python-library">https://github.com/transifex/transifex-python-library</a> * pygithub for Github API that can be downloaded using <em>pip install PyGithub</em>.</p> <a name="configuration"></a> <h2>Configuration</h2> <ul class="simple"> <li>In Transbot &gt; Configuration</li> </ul> <a name="transifex"></a> <h3>Transifex</h3> <ul class="simple"> <li>Configure a user and a password for Transifex. This cannot be done via a token, because Transifex doesn't allow this option. This data is stored as system parameters, so password is going to be in plain text, although in the configuration screen appears masked.</li> <li>Make sure to create a password authenticated user and not a oauth authenticated user (Linkedin, Github, Facebook).</li> <li>Configure a Transifex organization and team. Team is identified by a slug or name, derived from the real name you have put. The translation group is an id (number) that can be seen in the URL when you are on it on the web page.</li> <li>The Transifex translation group must have added the corresponding languages that can be synchronized with Github, or you will get an error on contrary.</li> </ul> <a name="github"></a> <h3>Github</h3> <ul class="simple"> <li>You have to issue a new token for the user you want to interact with on Github, with all the permissions granted, and put on the corresponding field on the configuration.</li> <li>Last, you have to create a Github project record for each of the repos, putting the organization of the repo and the project name in it. There is no support for now for personal repos, only organization repos, but it's very easy to create an organization for you only.</li> </ul> <a name="add-projects-to-transbot"></a> <h2>Add projects to Transbot</h2> <ul class="simple"> <li>Create a Github project and click on Get branches to retrieve current branches. You can deactivate any branch you don't want in the list (for example, dev branches).</li> <li>Then, you can click on <em>Check Github updates</em> to query active branches of the current Transbot project for new files, creating a Transifex project for each branch with this convention: &lt;project_name&gt; (&lt;branch_name&gt;), and uploading pot and po files. Here there can be errors that are logged (for example, an empty translation file like fr_BE.po in vertical-hotel).</li> <li>After this, you can click also on <em>Check Transifex updates</em>, which detects possible changes on translation strings on Transifex, and dump back on Github. This is awfully slow, but there's no other way, because it has to download each set of translation strings and check against saved hash, because Transifex doesn't provide any other method.</li> <li>There are 2 crons that can be changed for automatic check of both sides.</li> </ul> <a name="known-issues"></a> <h2>Known issues</h2> <ul class="simple"> <li>If you check Transifex updates before Github, it will be produce an inconsistent behaviour or even an error.</li> <li>Not all communications exceptions with APIs are processed (although all are logged), so maybe you will need to debug them to find out the problem.</li> </ul>