Skip to content

Instantly share code, notes, and snippets.

@dkalisch
Created September 28, 2013 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkalisch/6741068 to your computer and use it in GitHub Desktop.
Save dkalisch/6741068 to your computer and use it in GitHub Desktop.
YOURFILE.py
import gettext # module for the string replacement
t = gettext.translation('APPNAME', "./locales") # where does gettext find the language files
_ = t.ugettext # definition of strings to be translated
name = "Dominik"
print _("Hello world")
print _("My name is: %s") % name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment