def m18nc(context, englishText, *args): """ Wrapper around i18n. i18n only accepts and returns native strings. @param context: The context for this string. @type context: C{str} @param englishText : The text template. @type englishText: C{str} (utf-8) or C{unicode}. @param args : Arguments for the text template. @type args: A list or tuple of strings. @return: The translated text with args inserted. @rtype: C{unicode}. """ result = unicodeString( i18nc( context, nativeString(englishText), *unicodeStringArgs(args))) if not args: ENGLISHDICT[result] = unicodeString(englishText) return result
def m18n(englishText, *args): """ Wrapper around i18n. @param englishText : The text template. @type englishText: C{str} (utf-8) or C{unicode}. @param args : Arguments for the text template. @type args: A list or tuple of strings. @return: The translated text with args inserted. @rtype: C{unicode}. Since when do args have to be unicode? utf-8 encoded fails. """ result = unicodeString( i18n( nativeString( englishText), *unicodeStringArgs(args))) if not args: ENGLISHDICT[result] = unicodeString(englishText) return result