Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| translations:test-po-file [2026/09/09 05:31] – Add section dividers & link back to wiki translation main page kevinbowen | translations:test-po-file [2026/09/11 21:43] (current) – removed kevinbowen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~NOTOC~~ | ||
| - | ====== Test your translations ====== | ||
| - | |||
| - | When an application is being translated it is useful to see the result. This allows you to figure several points, e.g. to appreciate your labour, to check for ugly vs pretty messages, to spot mistakes, etc. | ||
| - | |||
| - | The PO files are compiled into MO files with the command line tool '' | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ===== The theory ===== | ||
| - | |||
| - | **1. Make a backup** \\ | ||
| - | NB: replace < | ||
| - | |||
| - | < | ||
| - | cd / | ||
| - | sudo cp < | ||
| - | </ | ||
| - | |||
| - | **2. Compile the PO file** | ||
| - | |||
| - | < | ||
| - | msgfmt -o < | ||
| - | </ | ||
| - | |||
| - | **3. Install the MO file** | ||
| - | |||
| - | < | ||
| - | sudo cp < | ||
| - | </ | ||
| - | |||
| - | **4. Run the application** \\ | ||
| - | NB: you can test an application in several languages by tweaking the environment variable LANG. However the locales have to be available on the system (this is particular to the underlying system you are running), otherwise the translations won't show up. | ||
| - | |||
| - | NB: you can display available locales with the command line tool "'' | ||
| - | |||
| - | < | ||
| - | LANG=< | ||
| - | </ | ||
| - | |||
| - | [[|Back to Top]] | ||
| - | ---- | ||
| - | |||
| - | ===== A real example ===== | ||
| - | |||
| - | < | ||
| - | ... connect to https:// | ||
| - | |||
| - | poedit xfburn.master.de.po | ||
| - | |||
| - | ... labour labour labour ... | ||
| - | |||
| - | msgfmt xfburn.master.de.po -o xfburn.mo | ||
| - | sudo mv / | ||
| - | sudo cp xfburn.mo / | ||
| - | LANG=de_DE.utf8 xfburn | ||
| - | </ | ||
| - | |||
| - | Afterwards if you are unhappy with the translations and want to test a new version... | ||
| - | |||
| - | < | ||
| - | poedit xfburn.master.de.po | ||
| - | msgfmt xfburn.master.de.po -o xfburn.mo | ||
| - | sudo cp xfburn.mo / | ||
| - | LANG=de_DE.utf8 xfburn | ||
| - | </ | ||
| - | |||
| - | [[|Back to Top]] | ||
| - | ---- | ||
| - | [[: | ||