Skip to content

Commit 16bf82e

Browse files
committed
Merge pull request #1 from savoirfairelinux/8.0-transbot
[IMP] Module description
2 parents 2da39a3 + 23a0f31 commit 16bf82e

File tree

2 files changed

+62
-7
lines changed

2 files changed

+62
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install:
1919
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
2020
- travis_install_nightly ${VERSION}
2121
- sudo pip install python-ldap
22-
- sudo pip install PyGithub
22+
- sudo pip install PyGithub # used by transbot
2323
- printf '[options]\n\nrunning_env = dev' > ${HOME}/.openerp_serverrc
2424
- ln -s server_environment_files_sample ./server_environment_files
2525
script:

transbot/__openerp__.py

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,68 @@
2929
.pot and .po files to a given Transifex account, and detects translations done
3030
on Transifex and dump back on Github.
3131
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+
============
3534
36-
**Known issues**:
35+
This module requires two external libraries:
3736
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
3994
an inconsistent behaviour or even an error.
4095
* Not all communications exceptions with APIs are caught and registered
4196
on log for now, so you can have that cron process halts silently, so please
@@ -47,7 +102,7 @@
47102
'base',
48103
],
49104
'external_dependencies': {
50-
'python': ['github'], # 'txlib'],
105+
'python': ['github', 'txlib'],
51106
},
52107
'data': [
53108
'data/ir_cron.xml',

0 commit comments

Comments
 (0)