mirror of https://github.com/apache/maven.git
Corrected a regression bug due to MNG-1216 ie Locale.ENGLISH is the default language for bundles. Reallowed the following configuration <locales>en,...</locales> by correcting initLocalesList() method.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@327801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1d5e18a4fc
commit
994773a024
|
@ -70,6 +70,9 @@ public class SiteMojo
|
|||
|
||||
private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/maven-site.vm";
|
||||
|
||||
/** The locale by default for all default bundles */
|
||||
private static final Locale DEFAULT_LOCALE = Locale.ENGLISH;
|
||||
|
||||
/**
|
||||
* Directory containing source for apt, fml and xdoc docs.
|
||||
*
|
||||
|
@ -136,6 +139,8 @@ public class SiteMojo
|
|||
private boolean addModules;
|
||||
|
||||
/**
|
||||
* Specifies the output encoding.
|
||||
*
|
||||
* @parameter expression="${outputEncoding}"
|
||||
* default-value="ISO-8859-1"
|
||||
*/
|
||||
|
@ -239,7 +244,7 @@ public class SiteMojo
|
|||
List localesList = initLocalesList();
|
||||
if ( localesList.isEmpty() )
|
||||
{
|
||||
localesList = Collections.singletonList( Locale.ENGLISH );
|
||||
localesList = Collections.singletonList( DEFAULT_LOCALE );
|
||||
}
|
||||
|
||||
// Default is first in the list
|
||||
|
@ -456,6 +461,8 @@ public class SiteMojo
|
|||
* Init the <code>localesList</code> variable.
|
||||
* <p>If <code>locales</code> variable is available, the first valid token will be the <code>defaultLocale</code>
|
||||
* for this instance of the Java Virtual Machine.</p>
|
||||
*
|
||||
* @return a list of <code>Locale</code>
|
||||
*/
|
||||
private List initLocalesList()
|
||||
{
|
||||
|
@ -480,6 +487,9 @@ public class SiteMojo
|
|||
continue;
|
||||
}
|
||||
|
||||
// Default bundles are in English
|
||||
if ( !locale.getLanguage().equals( DEFAULT_LOCALE.getLanguage() ) )
|
||||
{
|
||||
if ( !i18n.getBundle( "site-plugin", locale ).getLocale().getLanguage().equals( locale.getLanguage() ) )
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
@ -491,13 +501,14 @@ public class SiteMojo
|
|||
sb.append( "Contribution are welcome and greatly appreciated! " );
|
||||
sb.append( "\n" );
|
||||
sb.append( "If you want to contribute a new translation, please visit " );
|
||||
sb.append( "http://maven.apache.org/maven2/plugins/maven-site-plugin/i18n.html " );
|
||||
sb.append( "http://maven.apache.org/plugins/maven-site-plugin/i18n.html " );
|
||||
sb.append( "for detailed instructions." );
|
||||
|
||||
getLog().warn( sb.toString() );
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
localesList.add( locale );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue