/[gentoo-src]/portage/pym/portage_localization.py
Gentoo

Contents of /portage/pym/portage_localization.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download) (as text)
Sat Feb 26 06:35:20 2005 UTC (9 years, 1 month ago) by jstubbs
Branch: MAIN
CVS Tags: HEAD
Branch point for: portage_2_1
Changes since 1.2: +2 -1 lines
File MIME type: text/x-python
Brought forward changes from portage_2_0

1 # portage_localization.py -- Code to manage/help portage localization.
2 # Copyright 2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-src/portage/pym/portage_localization.py,v 1.2 2004/10/04 14:07:40 vapier Exp $
5 cvs_id_string="$Id: portage_localization.py,v 1.2.2.1 2005/01/16 02:35:33 carpaski Exp $"[5:-2]
6
7
8 # We define this to make the transition easier for us.
9 def _(mystr):
10 return mystr
11
12
13 def localization_example():
14 # Dict references allow translators to rearrange word order.
15 print _("You can use this string for translating.")
16 print _("Strings can be formatted with %(mystr)s like this.") % {"mystr": "VALUES"}
17
18 a_value = "value.of.a"
19 b_value = 123
20 c_value = [1,2,3,4]
21 print _("A: %(a)s -- B: %(b)s -- C: %(c)s") % {"a":a_value,"b":b_value,"c":c_value}

  ViewVC Help
Powered by ViewVC 1.1.20