[ 
https://issues.apache.org/jira/browse/DOXIASITETOOLS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated DOXIASITETOOLS-271:
------------------------------------------
    Description: 
The current locale setup has its flaws:
* It forces you assume that the default locale is English which leads to 
problems that {{site_en.xml}} is often not found
* Full locale cannot be used to create a site. The same language can differ 
from country to country.

This overhaul will implement two changes:
# The default locale will not be English anymore, but rather {{ROOT}} as a 
language-agnostic one.
# One can provide a full locale and Doxia Sitetools will incrementally reduce 
the locale from variant down to root to find the most specific site descriptor, 
e.g., {{'de_DE_BY', 'de_DE', 'de', ''}}. Assuming that the user has requested 
{{'de_DE_BY'}} as in German in Germany, specifically in Bavaria.

Both approaches apply the logic from 
[{{ResouceBundle#getBundle()}}|https://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html#getBundle-java.lang.String-java.util.Locale-java.lang.ClassLoader-].

  was:
The current locale setup has its flaws:
* It forces you assume that the default locale is English which leads to 
problems that {{site_en.xml}} is often not found
* Full locale cannot be used to create a site. The same language can differ 
from country to country.

A [telescopic 
approach|http://www.javabyexamples.com/telescoping-constructor-in-java] is to 
start from the most specificly provided locale and go down to the most general 
one:
{noformat}
'de_DE_BY', 'de_DE', 'de', ''
{noformat}

Assuming that the user has requested {{'de_DE_BY'}} as in German in Germany, 
specifically in Bavaria.


> Overhaul locale support (make Locale#ROOT instead of Locale#ENGLISH default 
> and use full locale)
> ------------------------------------------------------------------------------------------------
>
>                 Key: DOXIASITETOOLS-271
>                 URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-271
>             Project: Maven Doxia Sitetools
>          Issue Type: Improvement
>          Components: Integration Tools, Site renderer
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: 2.0.0-M4
>
>
> The current locale setup has its flaws:
> * It forces you assume that the default locale is English which leads to 
> problems that {{site_en.xml}} is often not found
> * Full locale cannot be used to create a site. The same language can differ 
> from country to country.
> This overhaul will implement two changes:
> # The default locale will not be English anymore, but rather {{ROOT}} as a 
> language-agnostic one.
> # One can provide a full locale and Doxia Sitetools will incrementally reduce 
> the locale from variant down to root to find the most specific site 
> descriptor, e.g., {{'de_DE_BY', 'de_DE', 'de', ''}}. Assuming that the user 
> has requested {{'de_DE_BY'}} as in German in Germany, specifically in Bavaria.
> Both approaches apply the logic from 
> [{{ResouceBundle#getBundle()}}|https://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html#getBundle-java.lang.String-java.util.Locale-java.lang.ClassLoader-].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to