annotate pyntnclick/i18n.py @ 822:108eeb4d8f65 pyntnclick

Convert map to use InteractText for room labels
author Neil Muller <neil@dip.sun.ac.za>
date Mon, 28 Jan 2013 18:29:32 +0200
parents beac13c4e982
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
769
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
1 # internationalization
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
2
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
3 from gettext import gettext
802
5ec7905b2365 Don't use resource module to find module locale data
Neil Muller <neil@dip.sun.ac.za>
parents: 769
diff changeset
4 from pkg_resources import resource_filename
769
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
5
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
6
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
7 def _(s):
43b49f1de828 Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
8 return unicode(gettext(s), "utf-8")
802
5ec7905b2365 Don't use resource module to find module locale data
Neil Muller <neil@dip.sun.ac.za>
parents: 769
diff changeset
9
5ec7905b2365 Don't use resource module to find module locale data
Neil Muller <neil@dip.sun.ac.za>
parents: 769
diff changeset
10
817
beac13c4e982 Also warn about out-of-date tool translations if running rect-drawer
Neil Muller <neil@dip.sun.ac.za>
parents: 802
diff changeset
11 def get_module_i18n_path(module, path='locale'):
802
5ec7905b2365 Don't use resource module to find module locale data
Neil Muller <neil@dip.sun.ac.za>
parents: 769
diff changeset
12 """Get the locale data from within the module."""
817
beac13c4e982 Also warn about out-of-date tool translations if running rect-drawer
Neil Muller <neil@dip.sun.ac.za>
parents: 802
diff changeset
13 return resource_filename(module, path)