Skip to content

Commit 5934347

Browse files
committed
expanded translations-merge-update.sh docs
1 parent beae2f2 commit 5934347

1 file changed

Lines changed: 90 additions & 1 deletion

File tree

scripts/README.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,59 @@
11
## translations-merge-update.sh
22

3-
This script requires `/etc/sudoers.d/translations-merge-update` with contents:
3+
4+
### Transifex configurations
5+
6+
7+
#### `~/.transifexrc`
8+
9+
On server:
10+
- `licenses` host
11+
- `/var/www/.transifexrc`:
12+
```ini
13+
[https://www.transifex.com]
14+
api_hostname = https://api.transifex.com
15+
hostname = https://www.transifex.com
16+
password = [REDACTED]
17+
username = api
18+
```
19+
20+
21+
#### `.tx/config`
22+
23+
In repo:
24+
- [creativecommons/cc.i18n][cc-i18n]
25+
- [`.tx/config`][tx-config]
26+
27+
On server:
28+
- `licenses` host
29+
- `/var/www/creativecommons.org/python_env/src/cc.i18n/.tx/config`:
30+
```ini
31+
[main]
32+
host = https://www.transifex.com
33+
34+
[CC.deeds-choosers]
35+
file_filter = cc/i18n/po/<lang>/cc_org.po
36+
lang_map = sr@latin:sr_LATN, zh_CN:zh
37+
source_file = cc/i18n/po/en/cc_org.po
38+
source_lang = en
39+
```
40+
- Specifies the **project** (`CC`) and the **resource** (`deeds-choosers`)
41+
42+
43+
[cc-i18n]: https://github.com/creativecommons/cc.i18n
44+
[tx-config]: https://github.com/creativecommons/cc.i18n/blob/master/.tx/config
45+
46+
47+
#### Documentation
48+
49+
- [Configuration Files | Transifex
50+
Documentation](https://docs.transifex.com/client/client-configuration)
51+
52+
53+
### sudo configuration
54+
55+
On the `licenses` host, this script requires
56+
`/etc/sudoers.d/translations-merge-update` with contents:
457
```
558
# vim: ft=sudoers
659
#
@@ -11,7 +64,43 @@ Cmnd_Alias APACHE_RESTART = /usr/sbin/service apache2 restart
1164
www-data ALL = NOPASSWD: APACHE_RESTART
1265
```
1366
67+
68+
### www-data crontab entry
69+
1470
It also expects a `www-data` crontab entry:
1571
```
1672
@hourly /var/www/creativecommons.org/scripts/translations-merge-update.sh
1773
```
74+
75+
76+
### Transifex Command
77+
78+
The `translations-merge-update.sh` script contains the following transifex
79+
client command:
80+
```shell
81+
tx -q pull -a --mode developer
82+
```
83+
- **`-q`**
84+
- *`-q`, `--quiet`: don't print status messages to stdout* (`tx --help`,
85+
formatting updated)
86+
- **`pull`**
87+
- *The `tx pull` command lets you download translation files from Transifex
88+
for use.*
89+
- **`-a`**
90+
- *`-a` or `--all`: Fetch all translation files from server, even ones which
91+
don’t exist already locally. If this option isn’t included, only the files
92+
that exist locally will be updated. If your pull command is skipping files,
93+
try to add this switch in combination with -f.*
94+
- **`--mode developer`**
95+
- *`developer`: The files downloaded will be compatible with the i18n
96+
support of the development framework you’re using. This is the default
97+
mode when you run tx pull. Use this mode when you intend to use the file
98+
e.g. in production. This mode auto-fills empty translations with the
99+
source language text for most of the file formats we support, which is
100+
critical in the case of file formats that require all translations to be
101+
non-empty.*
102+
103+
104+
#### Documentation
105+
106+
- [Pull: Download Files | Transifex Documentation](https://docs.transifex.com/client/pull/)

0 commit comments

Comments
 (0)