Project

General

Profile

Translating » History » Version 4

Lukas Zapletal, 04/02/2013 09:25 AM

1 2 Lukas Zapletal
h1. Translating (for contributors)
2 1 Lukas Zapletal
3
How to translate Foreman
4
5
h2. Using Transifex
6
7 2 Lukas Zapletal
Go to https://www.transifex.com/projects/p/foreman and register/login. Then you can use the Transifex interface to do all translations. The project on Transifex automatically updates when we add new strings into git. Foreman team regularly downloads new translations to the develop branch in git as well, therefore there is no action needed when you finish with translations. It will be pulled eventually (e.g. before the next release).
8
9
h2. Manually
10
11
If you prefer, you can edit PO files directly using your preferred editor. Please make sure the encoding of the files is UTF-8. It is also recommended to test your translations before submitting a Pull Request on the github using either:
12
13
  foreman# rake gettext:pack
14
15
or
16
17 1 Lukas Zapletal
  foreman# make -C locale
18 3 Lukas Zapletal
19
The above command should not print any error message. Also you should start Foreman UI and see if your translations do fit (sometimes longer strings can wrap or even break the UI). If you start Foreman in the production mode, you need to do one of the above commands every time you change your translation. In the development mode, you only need to restart Foreman to see the changes.
20 2 Lukas Zapletal
21
More info about contributing your translation directly is on our [[Contribute]] wiki page. 
22
23
h1. How to pull translations (for developers)
24 1 Lukas Zapletal
25 4 Lukas Zapletal
To get updated translations from Transifex you will need account there (https://www.transifex.com) and the tx cli tool.
26
27
On Fedora:
28
29
  # yum -y install transifex-client gettext make intltool
30
31
On Debian:
32
33
  # apt-get install transifex-client gettext make intltool-debian
34
35
Then configure your account:
36
37
  $ cat ~/.transifexrc
38
  [https://www.transifex.net]
39
  hostname = https://www.transifex.net
40
  username = <your_username>
41
  password = <your_password>
42
  token = <should be empty>
43
44
And then prepare new topic branch (because the following command will make new commits to your git repo):
45
46
  git checkout -b update-translations
47
48
Finally do the translation pull
49
50
  make -C locale tx-update
51
52
And then you can push changes.
53
54
  git push ...