[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r9908 - trunk/gnue-common/src/apps
From: |
reinhard |
Subject: |
[gnue] r9908 - trunk/gnue-common/src/apps |
Date: |
Thu, 19 Feb 2009 08:50:28 -0600 (CST) |
Author: reinhard
Date: 2009-02-19 08:50:28 -0600 (Thu, 19 Feb 2009)
New Revision: 9908
Modified:
trunk/gnue-common/src/apps/i18n.py
Log:
Use function pointers for deprecated function names. This fixes some
translation issues.
Modified: trunk/gnue-common/src/apps/i18n.py
===================================================================
--- trunk/gnue-common/src/apps/i18n.py 2009-02-18 13:03:02 UTC (rev 9907)
+++ trunk/gnue-common/src/apps/i18n.py 2009-02-19 14:50:28 UTC (rev 9908)
@@ -44,111 +44,13 @@
# -----------------------------------------------------------------------------
-# Convert Unicode to String, let everything else untouched. This is o().
+# Functions
# -----------------------------------------------------------------------------
-def outconv(message):
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Encodes a message to L{encoding} (the current locale's encoding). This
- function is available as the builtin function "o()".
- """
- return i18n.outconv(message)
-
-
-# -----------------------------------------------------------------------------
-# Translate a message and return unicode
-# -----------------------------------------------------------------------------
-
-def utranslate(message):
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Translates a message and returns a unicode string. This function is
- available as the builtin function "u_()".
- """
- return i18n.utranslate(message)
-
-
-# -----------------------------------------------------------------------------
-# Translate a message and return local encoding
-# -----------------------------------------------------------------------------
-
-def translate(message):
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Translates a message and returns an 8 bit string, encoded with L{encoding}
- (the current locale's encoding). This function is available as the builtin
- function "_()".
- """
- return i18n.translate(message)
-
-
-# -----------------------------------------------------------------------------
-# Get the current language
-# -----------------------------------------------------------------------------
-
-def getlanguage():
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Returns the language of the currently acitve locale. This can be changed
- with L{setcurrentlocale}.
-
- @return: language of the current locale.
- """
- return i18n.get_language()
-
-
-# -----------------------------------------------------------------------------
-# Get the current encoding
-# -----------------------------------------------------------------------------
-
-def getencoding():
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Returns the encoding of the currently active locale. This can be changed
- with L{setcurrentlocale}.
-
- @return: encoding of the current locale.
- """
- return i18n.get_encoding()
-
-
-# -----------------------------------------------------------------------------
-# Get the locale string of the current user
-# -----------------------------------------------------------------------------
-
-def getuserlocale():
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Try to find out which locale the user is using. This is always the locale
- of the user running the program and is not touched by setcurrentlocale.
-
- @return: localestring of the user's locale, i.e. address@hidden
- """
- return i18n.get_user_locale()
-
-
-# -----------------------------------------------------------------------------
-# Change the current locale
-# -----------------------------------------------------------------------------
-
-def setcurrentlocale(new_locale):
- """
- This module is *DEPRECATED*. Please use gnue.common.base.i18n instead.
-
- Set the current locale.
-
- If it fails it tries to succeed using a more general form of the requested
- locale, i.e. if 'address@hidden' fails, 'de_AT' will be tried next. If that
- fails too, 'de' will be tried.
-
- @param new_locale: string of the locale to be set, e.g. address@hidden
- (full blown) or 'de_AT' or 'en_AU'
- """
- return i18n.set_current_locale(new_locale)
+outconv = i18n.outconv
+utranslate = i18n.utranslate
+translate = i18n.translate
+getlanguage = i18n.get_language
+getencoding = i18n.get_encoding
+getuserlocale = i18n.get_user_locale
+setcurrentlocale = i18n.set_current_locale
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r9908 - trunk/gnue-common/src/apps,
reinhard <=