Skip to content
kwattro edited this page Apr 17, 2012 · 1 revision

Refactoring

I've created this page to hold discussion key points from the PR #5

General vision

  • Current version will be marked as 2.0 branch
  • A new 2.1 branch will be created to include the refactoring
  • master version will currently stay at 2.0 state to not break with users that did not follow PR #5 conversation

Configuration

  • Cookie parameters will be configurable
  • Detection mechanism priority configurable
  • Allowed_languages
  • Behavior for non_allowed_language ( implement a default one, other uses cases can come further )
  • Rendering of the locale switch ( implement 2 default use cases url links, form)

Detection mechanisms

  • BrowserLocale
  • RouterLocale
  • CookieLocale
  • FallbackLocale

The router, cookie, fallback mechanisms will not require a lot of code but it will make user configurable mechanism if they want to use their own class to override one of the mechanisms.

Locale Switch

  • Change the _locale in the router if the user switch language
  • Change the user _locale
  • Provide 2 default implementations ( form or url links )
  • Implementations templates need to be overwritable

Cookie

The cookie set need to be configurable, let's say users may want to set the cookie the first time a _locale is detected. Some other users may want to set the cookie only on user action (locale switch)

Locale validation

Regarding the possibility to use LocaleBundle or \Locale php class. To be continued. Need absolutely to be tested on Windows platform.

LocaleBundle provides a way to update locales from the ICU svn.