Django CMS 3.0.x Documentation
make your life easier, add the following at the top of the file: # -*- coding: utf-8 -*- import os gettext = lambda s: s BASE_DIR = os.path.dirname(os.path.dirname(__file__)) Add the following apps to your istory menu.add_sideframe_item(_('Delete this Poll'), url=reverse('admin:polls_poll_delete', args=[po return render(request, 'polls/detail.html', {'poll': poll}) Detecting url changes Sometimes toolbar Example: CMS_TEMPLATES = ( ('base.html', gettext('default')), ('2col.html', gettext('2 Column')), ('3col.html', gettext('3 Column')), ('extra.html', gettext('Some extra fancy template')), ) Note: All0 码力 | 180 页 | 1.56 MB | 6 月前3Tornado 6.5 Documentation
the .mo format used by gettext and related tools, and a simple .csv format. An application will generally call either tornado.locale. load_translations or tornado.locale.load_gettext_translations once at one of load_translations (which uses a simple CSV format) or load_gettext_translations (which uses the .mo format supported by gettext and related tools). If nei- ther method is called, the Locale.translate detection, UTF- 16, and UTF-8-with-BOM. tornado.locale.load_gettext_translations(directory: str, domain: str) → None Loads translations from gettext’s locale tree Locale tree is similar to system’s /usr/share/locale0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
supports loading translations in two formats: the .mo format used by gettext [https://docs.python.org/3/library/gettext.html#module-gettext] and related tools, and a simple .csv format. An application will will generally call either tornado.locale.load_translations or tornado.locale.load_gettext_translations once at startup; see those methods for more details on the supported formats. You can get the list tornado.locale — Internationalization support get() set_default_locale() load_translations() load_gettext_translations() get_supported_locales() Locale Locale.get_closest() Locale.get() Locale.translate()0 码力 | 437 页 | 405.14 KB | 2 月前3Django CMS 2.1.x Documentation
Chapter 1. Getting Started django cms Documentation, Release 2.1.5 # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) Add the following apps to Example: CMS_TEMPLATES = ( ('base.html', gettext('default')), ('2col.html', gettext('2 Column')), ('3col.html', gettext('3 Column')), ('extra.html', gettext('Some extra fancy template')), ) 1.3. Using 'extra_context': {"width":640}, 'name':gettext("Content"), }, 'right-column': { "plugins": ('TeaserPlugin', 'LinkPlugin'), "extra_context": {"width":280}, 'name':gettext("Right Column"), 'limits': { 'global':0 码力 | 63 页 | 485.38 KB | 6 月前3Django CMS 2.1.x Documentation
your life easier, add the following at the top of the file: # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) Add the following apps CMS_TEMPLATES = ( ('base.html', gettext('default')), ('2col.html', gettext('2 Column')), ('3col.html', gettext('3 Column')), ('extra.html', gettext('Some extra fancy template')), ) 4 {"width":640}, 'name':gettext("Content"), }, 'right-column': { "plugins": ('TeaserPlugin', 'LinkPlugin'), "extra_context": {"width":280}, 'name':gettext("Right Column"),0 码力 | 81 页 | 554.09 KB | 6 月前3Django CMS 2.2.x Documentation
make your life easier, add the following at the top of the file: # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) Add the following apps to Example: CMS_TEMPLATES = ( ('base.html', gettext('default')), ('2col.html', gettext('2 Column')), ('3col.html', gettext('3 Column')), ('extra.html', gettext('Some extra fancy template')), ) Note: All 'extra_context': {"width":640}, 'name':gettext("Content"), }, 'right-column': { "plugins": ('TeaserPlugin', 'LinkPlugin'), "extra_context": {"width":280}, 'name':gettext("Right Column"), 'limits': { 'global':0 码力 | 76 页 | 627.98 KB | 6 月前3Django CMS 2.3.x Documentation
make your life easier, add the following at the top of the file: # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) Add the following apps to Example: CMS_TEMPLATES = ( ('base.html', gettext('default')), ('2col.html', gettext('2 Column')), ('3col.html', gettext('3 Column')), ('extra.html', gettext('Some extra fancy template')), ) Note: All 'extra_context': {"width":640}, 'name':gettext("Content"), }, 'right-column': { "plugins": ['TeaserPlugin', 'LinkPlugin'], "extra_context": {"width":280}, 'name':gettext("Right Column"), 'limits': { 'global':0 码力 | 92 页 | 666.41 KB | 6 月前3Django CMS 2.4.x Documentation
{ 'code': 'en', 'name': gettext('English'), 'fallbacks': ['de', 'fr'], 'public': True, 'hide_untranslated': True, 'redirect_on_fallback':False, }, { 'code': 'de', 'name': gettext('Deutsch'), 'fallbacks': 'fallbacks': ['en', 'fr'], 'public': True, }, { 'code': 'fr', 'name': gettext('French'), 'public': False, }, ], 2: [ { 'code': 'nl', 'name': gettext('Dutch'), 'public': True, 'fallbacks': ['en'], }, ], 'default': make your life easier, add the following at the top of the file: # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0] Add the0 码力 | 104 页 | 709.98 KB | 6 月前3Django CMS 2.4.x Documentation
CMS_LANGUAGES = { 1: [ { 'code': 'en', 'name': gettext('English'), 'fallbacks': ['de', 'fr'], 'public': True, 'name': gettext('Deutsch'), 'fallbacks': ['en', 'fr'], 'public': True, }, { 'code': 'fr', 'name': gettext('French') }, ], 2: [ { 'code': 'nl', 'name': gettext('Dutch'), 'public': True, 'fallbacks': ['en'], },0 码力 | 156 页 | 727.78 KB | 6 月前3Django CMS 3.9.x Documentation
from polls_cms_integration.models import PollPluginModel from django.utils.translation import gettext as _ @plugin_pool.register_plugin # register the plugin class PollPluginPublisher(CMSPluginBase): in polls_cms_integration/: from django.urls import reverse from django.utils.translation import gettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from plugin_pool from cms.models.pluginmodel import CMSPlugin from django.utils.translation import gettext_lazy as _ @plugin_pool.register_plugin class HelloPlugin(CMSPluginBase): model = CMSPlugin0 码力 | 417 页 | 1.68 MB | 6 月前3
共 27 条
- 1
- 2
- 3