Add missing Django-parler setting
The lack of this setting constant causes `safe_translation_getter`
to fail to choose language to translate
It's probably a bug in Aldryn_newblog which call the function to early
@@ -78,15 +78,6 @@ class Base(DRFMixin, ElasticSearchMixin, Configuration):
USE_I18N = True
USE_L10N = True
USE_TZ = True
- LANGUAGE_CODE = 'fr'
- # Careful! Languages should be ordered by priority, as this tuple is used to get
- # fallback/default languages throughout the app.
- # Use "en" as default as it is the language that is most likely to be spoken by any visitor
- # when their preferred language, whatever it is, is unavailable
- LANGUAGES = (
- ('en', _('en')),
- ('fr', _('fr')),
- )
# Templates
TEMPLATES = [
@@ -185,31 +176,46 @@ class Base(DRFMixin, ElasticSearchMixin, Configuration):
# Group to add plugin to placeholder "Content"
FUN_PLUGINS_GROUP = "Fun Plugins"
+ LANGUAGE_CODE = 'fr'
+ # Careful! Languages should be ordered by priority, as this tuple is used to get
+ # fallback/default languages throughout the app.
+ # Use "en" as default as it is the language that is most likely to be spoken by any visitor
+ # when their preferred language, whatever it is, is unavailable
+ LANGUAGES = (
+ ('en', _('en')),
+ ('fr', _('fr')),
+ )
+
# Django CMS settings
CMS_LANGUAGES = {
'default': {
'public': True,
'hide_untranslated': False,
'redirect_on_fallback': True,
+ 'fallbacks': ['en', 'fr'],
},
1: [
{
'public': True,
- 'code': 'fr',
+ 'code': 'en',
'hide_untranslated': False,
- 'name': _('fr'),
+ 'name': _('en'),
+ 'fallbacks': ['fr'],
'redirect_on_fallback': True,
},
{
'public': True,
- 'code': 'en',
+ 'code': 'fr',
'hide_untranslated': False,
- 'name': _('en'),
- 'fallbacks': ['fr'],
+ 'name': _('fr'),
+ 'fallbacks': ['en'],
'redirect_on_fallback': True,
},
],
}
+
+ PARLER_LANGUAGES = CMS_LANGUAGES
+
CMS_TEMPLATES = (
('organizations/cms/organization.html', _("Organization page")),
('organizations/cms/organization_list.html', _("Organizations list page")),
