3 Compare the content of two PO files
4 ===================================
6 Here is how to check out the differences between two PO files without
7 caring about strings order, line breaks or comments.
9 diff -u <(msgfmt -o - translation/es/es.po | msgunfmt) \
10 <(msgfmt -o - persistence-setup/po/es.po | msgunfmt)
12 The syntax is bash specific. Replace the paths to the two PO files you
13 are interested in comparing.
15 Calculate statistics on the translations
16 ========================================
18 Run the [[language statistics.sh]] script.
20 Build the wiki offline
21 ======================
23 To check your translations before you send them, you may want to browse the
24 wiki offline. See the [[corresponding documentation|contribute/build/website]].
26 Search for fuzzy strings with Vim
27 =================================
29 Ran inside Vim, the following command will search recursively for *fuzzy*
32 :vimgrep /fuzzy/ **/*.fr.po |:copen
34 To switch easily between the file list and the editor, using Alt + Arrow
35 up/down, you can add those lines in .vimrc:
37 nmap <silent> <A-Up> :wincmd k<CR>
38 nmap <silent> <A-Down> :wincmd j<CR>
40 Check the validity of PO files
41 ==============================
43 Use the tool [i18nspector](http://jwilk.net/software/i18nspector).
45 To copy, install and run it issue the following commands in the folder where
46 you want to download it:
48 apt-get install i18nspector/unstable
51 Run i18nspector on the whole wiki
52 =================================
55 contribute/l10n_tricks/check_po.sh
60 To rewrap one .po file:
62 msgcat --width=80 -o your_output_file.po your_input_file.po
64 To rewrap several .po files:
66 for f in $(find . -type f -name .po) ; do msgcat --width=80 -o \
67 "${f}.new" "$f" ; mv -f "${f}.new" "$f" ; done
69 To rewrap a .mdwn file:
71 fold -s -w 80 translate.mdwn > translate.mdwn.out
73 Quickly update several repositories
74 ===================================
76 Tails is split in [[several git repositories|contribute/git]]: tails-greeter,
77 whisperback, persistence-setup, *etc*.
79 If you cloned those differents repositories in the same folder, you can pull them all
80 in a row with the following bash script:
83 for d in $(find . -type d -name ".git" | sed 's/\/.git\+$//' ); do
84 echo "Current repository: $d";
85 cd $d && git pull && cd - || exit 1
88 This will basically check in all subfolders if there is an existing `.git` folder,
89 and run `git pull` if appropriate.
91 Remove autogenerated PO files
92 =============================
94 When building the wiki, ikiwiki often generates many PO files that you don't
95 need to take into account or commit if you are working on the documentation or
96 only on one language. This [[script|git-clean-po]] does a checkout on all of
97 the modified PO files in your working tree. **Make sure to do `git add` on the
98 files that you modified before running it**, otherwise your changes will be
101 List Transifex translators
102 ==========================
104 This script lists people who did translation work on Transifex. You first need
105 to import those translation using the `./import-translations` script.
109 - a team using Git to get in touch regularly with the translators on Transifex
110 so that they don't waste their time without anyone telling them.
111 - a new team to recruit translator to work on the website.
113 Execute from the root of the Git repository:
115 ./import-translations
116 ./wiki/src/contribute/l10n_tricks/transifex_translators.sh