Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
locales
  • Loading branch information
digi604 committed Apr 6, 2013
1 parent 0f5a2e3 commit c9d8997
Show file tree
Hide file tree
Showing 48 changed files with 8,261 additions and 8,914 deletions.
369 changes: 181 additions & 188 deletions cms/locale/ar/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/bg/LC_MESSAGES/django.po

Large diffs are not rendered by default.

332 changes: 147 additions & 185 deletions cms/locale/bn/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/ca/LC_MESSAGES/django.po

Large diffs are not rendered by default.

363 changes: 175 additions & 188 deletions cms/locale/cs/LC_MESSAGES/django.po

Large diffs are not rendered by default.

332 changes: 147 additions & 185 deletions cms/locale/cy/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/da/LC_MESSAGES/django.po

Large diffs are not rendered by default.

528 changes: 295 additions & 233 deletions cms/locale/de/LC_MESSAGES/django.po

Large diffs are not rendered by default.

345 changes: 158 additions & 187 deletions cms/locale/el/LC_MESSAGES/django.po

Large diffs are not rendered by default.

344 changes: 155 additions & 189 deletions cms/locale/en/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/es/LC_MESSAGES/django.po

Large diffs are not rendered by default.

344 changes: 157 additions & 187 deletions cms/locale/es_AR/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/es_BO/LC_MESSAGES/django.po

Large diffs are not rendered by default.

362 changes: 160 additions & 202 deletions cms/locale/es_DO/LC_MESSAGES/django.po

Large diffs are not rendered by default.

351 changes: 164 additions & 187 deletions cms/locale/et/LC_MESSAGES/django.po

Large diffs are not rendered by default.

360 changes: 172 additions & 188 deletions cms/locale/eu/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/fa/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/fi/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/fr/LC_MESSAGES/django.po

Large diffs are not rendered by default.

332 changes: 147 additions & 185 deletions cms/locale/gu/LC_MESSAGES/django.po

Large diffs are not rendered by default.

335 changes: 149 additions & 186 deletions cms/locale/he/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/hi/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/hr/LC_MESSAGES/django.po

Large diffs are not rendered by default.

356 changes: 168 additions & 188 deletions cms/locale/hu/LC_MESSAGES/django.po

Large diffs are not rendered by default.

354 changes: 167 additions & 187 deletions cms/locale/is/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/it/LC_MESSAGES/django.po

Large diffs are not rendered by default.

348 changes: 158 additions & 190 deletions cms/locale/ja/LC_MESSAGES/django.po

Large diffs are not rendered by default.

335 changes: 149 additions & 186 deletions cms/locale/ka/LC_MESSAGES/django.po

Large diffs are not rendered by default.

363 changes: 175 additions & 188 deletions cms/locale/km/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/ku_IQ/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/nb/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/nl/LC_MESSAGES/django.po

Large diffs are not rendered by default.

354 changes: 167 additions & 187 deletions cms/locale/no/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/pl/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/pt/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/pt_BR/LC_MESSAGES/django.po

Large diffs are not rendered by default.

360 changes: 169 additions & 191 deletions cms/locale/ro/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/ru/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/sk/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/sl_SI/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/sr@latin/LC_MESSAGES/django.po

Large diffs are not rendered by default.

468 changes: 249 additions & 219 deletions cms/locale/sv/LC_MESSAGES/django.po

Large diffs are not rendered by default.

332 changes: 147 additions & 185 deletions cms/locale/th_TH/LC_MESSAGES/django.po

Large diffs are not rendered by default.

366 changes: 178 additions & 188 deletions cms/locale/tr/LC_MESSAGES/django.po

Large diffs are not rendered by default.

338 changes: 152 additions & 186 deletions cms/locale/uk/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/zh_CN/LC_MESSAGES/django.po

Large diffs are not rendered by default.

369 changes: 181 additions & 188 deletions cms/locale/zh_TW/LC_MESSAGES/django.po

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions cms/plugins/utils.py
Expand Up @@ -20,6 +20,7 @@ def get_plugins(request, placeholder, lang=None):
assign_plugins(request, [placeholder], lang)
return getattr(placeholder, '_%s_plugins_cache' % lang)


def assign_plugins(request, placeholders, lang=None):
"""
Fetch all plugins for the given ``placeholders`` and
Expand All @@ -39,8 +40,9 @@ def assign_plugins(request, placeholders, lang=None):
if fallback in languages:
request_lang = fallback
break
# get all plugins for the given placeholders
qs = get_cmsplugin_queryset(request).filter(placeholder__in=placeholders, language=request_lang).order_by('placeholder', 'tree_id', 'lft')
# get all plugins for the given placeholders
qs = get_cmsplugin_queryset(request).filter(placeholder__in=placeholders, language=request_lang).order_by(
'placeholder', 'tree_id', 'lft')
plugin_list = downcast_plugins(qs)

# split the plugins up by placeholder
Expand All @@ -51,6 +53,7 @@ def assign_plugins(request, placeholders, lang=None):
for placeholder in placeholders:
setattr(placeholder, '_%s_plugins_cache' % lang, list(groups.get(placeholder.pk, [])))


def build_plugin_tree(plugin_list):
root = []
cache = {}
Expand All @@ -68,6 +71,7 @@ def build_plugin_tree(plugin_list):
plugin.child_plugin_instances.sort(key=lambda x: x.position)
return root


def downcast_plugins(queryset, select_placeholder=False):
plugin_types_map = defaultdict(list)
plugin_lookup = {}
Expand All @@ -86,19 +90,20 @@ def downcast_plugins(queryset, select_placeholder=False):
# downcasted versions
for instance in plugin_qs:
plugin_lookup[instance.pk] = instance
# make the equivalent list of qs, but with downcasted instances
# make the equivalent list of qs, but with downcasted instances
plugin_list = [plugin_lookup[p.pk] for p in queryset if p.pk in plugin_lookup]
return plugin_list


def get_plugins_for_page(request, page, lang=None):
from cms.utils.plugins import get_placeholders

if not page:
return []
lang = lang or get_language_from_request(request)
if not hasattr(page, '_%s_plugins_cache' % lang):
slots = get_placeholders(page.template)
setattr(page, '_%s_plugins_cache' % lang, get_cmsplugin_queryset(request).filter(
setattr(page, '_%s_plugins_cache' % lang, get_cmsplugin_queryset(request).filter(
placeholder__page=page, placeholder__slot__in=slots, language=lang, parent__isnull=True
).order_by('placeholder', 'position').select_related())
return getattr(page, '_%s_plugins_cache' % lang)
Expand All @@ -125,5 +130,7 @@ def has_reached_plugin_limit(placeholder, plugin_type, language, template=None):
).count()
if type_count >= type_limit:
plugin_name = unicode(plugin_pool.get_plugin(plugin_type).name)
raise PluginLimitReached(_("This placeholder already has the maximum number (%s) of allowed %s plugins.") % (type_limit, plugin_name))
raise PluginLimitReached(_(
"This placeholder already has the maximum number (%(limit)s) of allowed %(plugin_name)s plugins.") \
% {'limit': type_limit, 'plugin_name': plugin_name})
return False

0 comments on commit c9d8997

Please sign in to comment.