Author: evenisse Date: Wed Jun 22 15:08:24 2005 New Revision: 193004 URL: http://svn.apache.org/viewcvs?rev=193004&view=rev Log: Add i18n translations for mailing lists report
Added: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties (with props) maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties (with props) Modified: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java Modified: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java?rev=193004&r1=193003&r2=193004&view=diff ============================================================================== --- maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java (original) +++ maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java Wed Jun 22 15:08:24 2005 @@ -30,6 +30,7 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.ResourceBundle; /** * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a> @@ -65,7 +66,7 @@ */ public String getName( Locale locale ) { - return "Mailing Lists"; + return getBundle( locale ).getString( "report.mailing-lists.name" ); } /** @@ -81,7 +82,7 @@ */ public String getDescription( Locale locale ) { - return "This document provides subscription and archive information for this project's mailing lists."; + return getBundle( locale ).getString( "report.mailing-lists.description" ); } /** @@ -116,7 +117,7 @@ { try { - MailingListsRenderer r = new MailingListsRenderer( getSink(), getProject().getModel() ); + MailingListsRenderer r = new MailingListsRenderer( getSink(), getProject().getModel(), locale ); r.render(); } @@ -139,11 +140,15 @@ { private Model model; - public MailingListsRenderer( Sink sink, Model model ) + private Locale locale; + + public MailingListsRenderer( Sink sink, Model model, Locale locale ) { super( sink ); this.model = model; + + this.locale = locale; } /** @@ -152,7 +157,7 @@ // How to i18n these ... public String getTitle() { - return "Project Mailing Lists"; + return getBundle( locale ).getString( "report.mailing-lists.title" ); } /** @@ -165,17 +170,17 @@ if ( model.getMailingLists().isEmpty() ) { // TODO: should the report just be excluded? - paragraph( "There are no mailing lists currently associated with this project." ); + paragraph( getBundle( locale ).getString( "report.mailing-lists.nolist" ) ); } else { - paragraph( "These are the mailing lists that have been established for this project. For each list, " + - "there is a subscribe, unsubscribe, and an archive link." ); + paragraph( getBundle( locale ).getString( "report.mailing-lists.intro" ) ); startTable(); // To beautify the display boolean otherArchives = false; + for ( Iterator i = model.getMailingLists().iterator(); i.hasNext(); ) { MailingList m = (MailingList) i.next(); @@ -185,13 +190,25 @@ } } + String name = getBundle( locale ).getString( "report.mailing-lists.column.name" ); + + String subscribe = getBundle( locale ).getString( "report.mailing-lists.column.subscribe" ); + + String unsubscribe = getBundle( locale ).getString( "report.mailing-lists.column.unsubscribe" ); + + String post = getBundle( locale ).getString( "report.mailing-lists.column.post" ); + + String archive = getBundle( locale ).getString( "report.mailing-lists.column.archive" ); + + String archivesOther = getBundle( locale ).getString( "report.mailing-lists.column.otherArchives" ); + if ( otherArchives ) { - tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Post", "Archive", "Other Archives"} ); + tableHeader( new String[]{name, subscribe, unsubscribe, post, archive, archivesOther} ); } else { - tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Post", "Archive"} ); + tableHeader( new String[]{name, subscribe, unsubscribe, post, archive} ); } for ( Iterator i = model.getMailingLists().iterator(); i.hasNext(); ) @@ -216,7 +233,7 @@ if ( m.getSubscribe() != null ) { - textRow.add( "Subscribe" ); + textRow.add( subscribe ); hrefRow.add( m.getSubscribe() ); } else @@ -227,7 +244,7 @@ if ( m.getUnsubscribe() != null ) { - textRow.add( "Unsubscribe" ); + textRow.add( unsubscribe ); hrefRow.add( m.getUnsubscribe() ); } else @@ -238,7 +255,7 @@ if ( m.getPost() != null ) { - textRow.add( "Post" ); + textRow.add( post ); hrefRow.add( m.getPost() ); } else @@ -323,6 +340,11 @@ } endSection(); } + } + + private static ResourceBundle getBundle( Locale locale ) + { + return ResourceBundle.getBundle("project-info-report", locale, MailingListsReport.class.getClassLoader() ); } /** Added: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties?rev=193004&view=auto ============================================================================== --- maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties (added) +++ maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties Wed Jun 22 15:08:24 2005 @@ -0,0 +1,11 @@ +report.mailing-lists.name=Mailing Lists +report.mailing-lists.nolist=There are no mailing lists currently associated with this project. +report.mailing-lists.title=Project Mailing Lists +report.mailing-lists.description=This document provides subscription and archive information for this project's mailing lists. +report.mailing-lists.intro=These are the mailing lists that have been established for this project. For each list, there is a subscribe, unsubscribe, and an archive link. +report.mailing-lists.column.name=Name +report.mailing-lists.column.subscribe=Subscribe +report.mailing-lists.column.unsubscribe=Unsubscribe +report.mailing-lists.column.post=Post +report.mailing-lists.column.archive=Archive +report.mailing-lists.column.otherArchives=Other Archives Propchange: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties?rev=193004&view=auto ============================================================================== --- maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties (added) +++ maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties Wed Jun 22 15:08:24 2005 @@ -0,0 +1,11 @@ +report.mailing-lists.name=Listes de diffusion +report.mailing-lists.nolist= Il n'y a aucune liste de diffusion actuellement liée à ce projet. +report.mailing-lists.title=Listes de diffusion du projet +report.mailing-lists.description=Ce document fournit les informations de souscription et d'archive pour les listes de diffusion de ce projet. +report.mailing-lists.intro=Ce sont les listes de diffusion qui ont été établies pour ce projet. Pour chaque liste, il ya un lien d'abonnement, de désabonnement, et d'archive. +report.mailing-lists.column.name=Nom +report.mailing-lists.column.subscribe=S'incrire +report.mailing-lists.column.unsubscribe=Se désinscrire +report.mailing-lists.column.post=Poster +report.mailing-lists.column.archive=Archive +report.mailing-lists.column.otherArchives=Autres Archives Propchange: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/trunk/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]