Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding site with default language 'de-at' breaks #411

Closed
thet opened this issue Apr 1, 2015 · 11 comments
Closed

adding site with default language 'de-at' breaks #411

thet opened this issue Apr 1, 2015 · 11 comments

Comments

@thet
Copy link
Member

thet commented Apr 1, 2015

With current Plone 5 beta 1 and the merged language control panel, adding a site with a language like 'de-at' breaks and gives the following traceback:

2015-04-01 20:25:30 ERROR Zope.SiteErrorLog 1427912730.490.962488456232 http://localhost:8888/@@plone-addsite
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFPlone.browser.admin, line 232, in __call__
  Module Products.CMFPlone.factory, line 95, in addPloneSite
  Module plone.registry.registry, line 47, in __setitem__
  Module plone.registry.record, line 83, in _set_value
  Module zope.schema._bootstrapfields, line 182, in validate
  Module zope.schema._field, line 389, in _validate
ConstraintNotSatisfied: de-at

Please note, 'de-at' is selected by default, as reported by my browser.

  • Products.CMFPlone.browser.admin.AddPloneSite.languages uses plone.i18n.locales.interfaces.IContentLanguageAvailability and constructs a list of languages with combined language codes, if the default language as reported by the browser contains a "-".
  • Products.CMFPlone.interfaces.controlpanel.ILanguageSchema.use_combined_language_codes as a default value of False.
  • plone.app.vocabularies.language.AvailableContentLanguageVocabulary constructs it's language list via plone.i18n.utility.LanguageUtility.getAvailableLanguages according to the setting use_combined_language_codes, which is False by default.

I guess, we have to set use_combined_language_codes to True in CMFPlone/factory, if CMFPlone/admin/AddPloneSite decides to use combined language codes...

@thet
Copy link
Member Author

thet commented Apr 1, 2015

^^^ @bloodbare @tisto

@thet
Copy link
Member Author

thet commented Apr 2, 2015

workaround for a successful install: choose 'de' or anything else as long it is not a combined language when adding a site.

@hvelarde
Copy link
Member

confirmed over here

@Martronic-SA
Copy link

The problem is still there in the 5.0b2 (fr-ch)

@jaroel
Copy link
Member

jaroel commented Jul 15, 2015

Currently we don't have an option to select a combined language. Not sure why yet.

@jaroel jaroel assigned thet and unassigned jaroel Jul 15, 2015
@jaroel
Copy link
Member

jaroel commented Jul 15, 2015

Right, it only shows when your browser says it's language is something with a '-' in it.

@thet
Would it be acceptable to only allow 'DE' in plone-addsite, and use plone_control_panel to select a specific locale?

@davilima6
Copy link
Member

IMO 5.0 should definitely allow specific locales but for a post-sprint 5.0b3 it's very acceptable :)

@thet
Copy link
Member Author

thet commented Jul 15, 2015

@jaroel i'm not sure if i like to remove the ability to use combined language codes (even if your pull #684 simplifies the code :) )

IIRC, it would be enough to let the use_combined_language_codes setting in Products.CMFPlone.interfaces.controlpanel default to True.

@jaroel
Copy link
Member

jaroel commented Jul 16, 2015

Do we see a good reason not to show the whole list by default?
The browser language is already selected.

@bloodbare
Copy link
Member

It can be tricky for most of the sites to need to choose between different english flavous.

@jaroel
Copy link
Member

jaroel commented Jul 16, 2015

I've reworked the language selection in #693 .
It groups all country specific languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants