Example #1
0
 def lang(self, source):
     key = 'en'
     for line in lazy_split_lines(source):
         if not comment_or_empty_line.match(line):
             break
         match = language_pattern.match(line)
         if match:
             key = match.groups(1)[0]
     return I18n.get(key)
Example #2
0
 def test_print_available_languages(self):
     assert u"\n" + I18n.language_table() == u"""
Example #3
0
 def test_report_keyword_regexp(self):
     expected_substring = '|Quando |Quand |Quan |Pryd |Pokud |'
     assert expected_substring in I18n.keyword_regexp('step')
Example #4
0
 def test_reject_bullet_stars(self):
     assert '*' not in I18n.all_code_keywords()
Example #5
0
 def test_have_code_keywords_without_punctuation(self):
     code_keywords = (u'Avast', u'Akkor', u'Etantdonné', u'Lorsque', u'假設')
     for code_keyword in code_keywords:
         assert code_keyword in I18n.all_code_keywords()
Example #6
0
 def test_print_keyword_for_a_given_language(self):
     assert u"\n" + I18n.get('fr').keyword_table() == u"""