xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/examples/hello-python/hello.py.in (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1*946379e7Schristos# Example for use of GNU gettext.
2*946379e7Schristos# Copyright (C) 2003 Free Software Foundation, Inc.
3*946379e7Schristos# This file is in the public domain.
4*946379e7Schristos#
5*946379e7Schristos# Source code of the Python program.
6*946379e7Schristos
7*946379e7Schristosimport gettext
8*946379e7Schristosimport os
9*946379e7Schristos
10*946379e7Schristosgettext.textdomain('hello-python')
11*946379e7Schristosgettext.bindtextdomain('hello-python', '@localedir@')
12*946379e7Schristos
13*946379e7Schristosprint gettext.gettext("Hello, world!")
14*946379e7Schristosprint gettext.gettext("This program is running as process number %(pid)d.") \
15*946379e7Schristos      % { 'pid': os.getpid() }
16