當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。