当前位置: 首页>>代码示例>>Python>>正文


Python i18n.javascript_catalog方法代码示例

本文整理汇总了Python中django.views.i18n.javascript_catalog方法的典型用法代码示例。如果您正苦于以下问题:Python i18n.javascript_catalog方法的具体用法?Python i18n.javascript_catalog怎么用?Python i18n.javascript_catalog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.views.i18n的用法示例。


在下文中一共展示了i18n.javascript_catalog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: i18n_javascript

# 需要导入模块: from django.views import i18n [as 别名]
# 或者: from django.views.i18n import javascript_catalog [as 别名]
def i18n_javascript(self, request):
        """
        Displays the i18n JavaScript that the Django admin requires.

        This takes into account the USE_I18N setting. If it's set to False, the
        generated JavaScript will be leaner and faster.
        """
        if settings.USE_I18N:
            from django.views.i18n import javascript_catalog
        else:
            from django.views.i18n import null_javascript_catalog as javascript_catalog
        return javascript_catalog(request, packages=['django.conf', 'xadmin'])

# This global object represents the default admin site, for the common case.
# You can instantiate AdminSite in your own code to create a custom admin site. 
开发者ID:stormsha,项目名称:StormOnline,代码行数:17,代码来源:sites.py

示例2: i18n_javascript

# 需要导入模块: from django.views import i18n [as 别名]
# 或者: from django.views.i18n import javascript_catalog [as 别名]
def i18n_javascript(self, request):
        """
        Displays the i18n JavaScript that the Django admin requires.

        This takes into account the USE_I18N setting. If it's set to False, the
        generated JavaScript will be leaner and faster.
        """
        if settings.USE_I18N:
            from django.views.i18n import javascript_catalog
        else:
            from django.views.i18n import null_javascript_catalog as javascript_catalog
        return javascript_catalog(request, packages=['django.conf', 'django.contrib.admin']) 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:14,代码来源:sites.py

示例3: jsi18n

# 需要导入模块: from django.views import i18n [as 别名]
# 或者: from django.views.i18n import javascript_catalog [as 别名]
def jsi18n(request):
    return javascript_catalog(request, 'djangojs', ['userlog']) 
开发者ID:aaugustin,项目名称:django-userlog,代码行数:4,代码来源:views.py

示例4: cached_javascript_catalog

# 需要导入模块: from django.views import i18n [as 别名]
# 或者: from django.views.i18n import javascript_catalog [as 别名]
def cached_javascript_catalog(request, domain='djangojs', packages=None):
    """
    https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#note-on-performance
    """
    return javascript_catalog(request, domain, packages) 
开发者ID:erigones,项目名称:esdc-ce,代码行数:7,代码来源:views.py


注:本文中的django.views.i18n.javascript_catalog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。