コード例 #1
0
ファイル: test_gettext.py プロジェクト: LeongWei/bedrock
 def test_template_tag_set_default_locale(self):
     """The default language should always have every tag."""
     ok_(template_has_tag('the_dude', 'en-US', 'active'))
コード例 #2
0
ファイル: helpers.py プロジェクト: zulqarnain4/bedrock
def l10n_has_tag(ctx, tag, langfile=None):
    """Return boolean whether the given template's lang files have the given tag."""
    if langfile:
        return lang_file_has_tag(langfile, ctx['LANG'], tag)
    else:
        return template_has_tag(ctx['template'], ctx['LANG'], tag)
コード例 #3
0
ファイル: test_gettext.py プロジェクト: zulqarnain4/bedrock
 def test_template_tag_set_default_locale(self):
     """The default language should always have every tag."""
     ok_(template_has_tag('the_dude', 'en-US', 'active'))
コード例 #4
0
ファイル: helpers.py プロジェクト: Delphine/bedrock
def l10n_has_tag(ctx, tag, langfile=None):
    """Return boolean whether the given template's lang files have the given tag."""
    if langfile:
        return lang_file_has_tag(langfile, ctx['LANG'], tag)
    else:
        return template_has_tag(ctx['template'], ctx['LANG'], tag)