Commits

Akira TAGOH  committed b38e73e

Use Pango.Language.get_sample_string() instead of own pangram

  • Participants
  • Parent commits d3fa254

Comments (0)

Files changed (2)

File fontstweak/aliasui.py

 from gi.repository import GObject
 from gi.repository import Gtk
 from gi.repository import Easyfc
+from gi.repository import Pango
 from xml.sax.saxutils import quoteattr
 from xml.sax.saxutils import escape
 
 class FontsTweakAliasUI:
 
     alias_names = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy']
-    sample_text = N_('The quick brown fox jumps over the lazy dog. 1234567890')
 
     def __init__(self, config, builder, parent):
         self.__initialized = False
             self.labels[alias].set_markup(
                 "<span font_family=%s font_size=\"small\">%s</span>" % (
                     quoteattr(font),
-                    escape(FontsTweakUtil.translate_text(self.sample_text, lang))))
+                    escape(unicode(Pango.Language.get_sample_string(Pango.Language.from_string(lang)), 'utf-8'))))

File fontstweak/util.py

         return builder
 
     @classmethod
-    def translate_text(self, text, lang):
-        try:
-            self.translations
-        except AttributeError:
-            self.translations = {}
-        if self.translations.has_key(lang) == False:
-            self.translations[lang] = gettext.translation(
-                domain=FontsTweak.GETTEXT_PACKAGE,
-                localedir=FontsTweak.LOCALEDIR,
-                languages=[lang.replace('-', '_')],
-                fallback=True,
-                codeset="utf8")
-        return unicode(self.translations[lang].gettext(text), "utf8")
-
-    @classmethod
     def get_language_list(self, default):
         dict = OrderedDict()
         if default == True: