printrun-src/README.i18n

Wed, 20 Jan 2021 11:37:03 +0100

author
mdd
date
Wed, 20 Jan 2021 11:37:03 +0100
changeset 48
3c27b4ee6fec
parent 45
c82943fb205f
permissions
-rw-r--r--

reimplemented lasercutter changes

15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
1
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
2 Printrun Internationalization
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
3
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
4 Date: 06 August 2011
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
5 Author: Jonathan Marsden <jmarsden@.fastmail.fm>
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
6
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
7 Printrun is in the very early stages of being internationalized.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
8
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
9 The pronterface.py now uses gettext for the messages it generates.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
10 The corresponding pronterface.pot file is at locale/pronterface.pot
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
11 and was generated using
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
12
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
13 pygettext -o locale/pronterface.pot *.py printrun/*.py printrun/*/*.py
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
14
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
15 followed by minor edits to the generated header.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
16
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
17 This template is the basis for all pronterface mesage catalogs. Right
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
18 now there is only one, for German. New ones can be created:
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
19
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
20 # Create new pronterface message catalog for a different language
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
21 newlang="es" # use the correct code for your language
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
22 mkdir -p locale/${newlang}/LC_MESSAGES
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
23 cp locale/pronterface.pot locale/${newlanguage}/LC_MESSAGES/pronterface.po
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
24 cd locale/${newlanguage}/LC_MESSAGES/
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
25 # Edit the .po file to add messages for newlang
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
26 msgfmt -o pronterface.mo pronterface.po
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
27
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
28 To update a previously created message catalog from the template, use :
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
29
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
30 msgmerge -U locale/fr/LC_MESSAGES/pronterface.po locale/pronterface.pot
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
31
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
32 As currently coded, the default location for these message catalogs is
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
33
45
c82943fb205f updated main files to new github master version
mdd
parents: 15
diff changeset
34 /usr/share/locale/
15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
35
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
36 So, to install the catalogs, copy them to there:
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
37
45
c82943fb205f updated main files to new github master version
mdd
parents: 15
diff changeset
38 sudo cp -a locale /usr/share/
15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
39
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
40 To test pronterface in a new language, you can temporarily set LANG to
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
41 the language you are testing, for example
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
42
45
c82943fb205f updated main files to new github master version
mdd
parents: 15
diff changeset
43 LANG=de.UTF-8 python pronterface.py
15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
44
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
45 Further automation for localization and packaging of Printrun would be
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
46 nice to see, but is not here yet.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
47

mercurial