diff --git a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java index c56c9e6358..ff20ef6385 100644 --- a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java +++ b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java @@ -28,6 +28,7 @@ import org.codehaus.doxia.site.renderer.SiteRenderer; import java.io.IOException; import java.util.Iterator; import java.util.Locale; +import java.util.ResourceBundle; /** * @goal dependencies @@ -64,7 +65,7 @@ public class DependenciesReport */ public String getName( Locale locale ) { - return "Dependencies"; + return getBundle( locale ).getString( "report.dependencies.name" ); } /** @@ -80,7 +81,7 @@ public class DependenciesReport */ public String getDescription( Locale locale ) { - return "This document lists the projects dependencies and provides information on each dependency."; + return getBundle( locale ).getString( "report.dependencies.description" ); } /** @@ -115,7 +116,7 @@ public class DependenciesReport { try { - DependenciesRenderer r = new DependenciesRenderer( getSink(), getProject().getModel() ); + DependenciesRenderer r = new DependenciesRenderer( getSink(), getProject().getModel(), locale ); r.render(); } @@ -138,17 +139,21 @@ public class DependenciesReport { private Model model; - public DependenciesRenderer( Sink sink, Model model ) + private Locale locale; + + public DependenciesRenderer( Sink sink, Model model, Locale locale ) { super( sink ); this.model = model; + + this.locale = locale; } // How to i18n these ... public String getTitle() { - return "Project Dependencies"; + return getBundle( locale ).getString( "report.dependencies.title" ); } public void renderBody() @@ -158,17 +163,21 @@ public class DependenciesReport if ( model.getDependencies().isEmpty() ) { // TODO: should the report just be excluded? - paragraph( "There are no dependencies for this project. It is a standalone " + - "application that does not depend on any other project." ); + paragraph( getBundle( locale ).getString( "report.dependencies.nolist" ) ); } else { startTable(); - tableCaption( "The following is a list of dependencies for this project. These dependencies " + - "are required to compile and run the application:" ); + tableCaption( getBundle( locale ).getString( "report.dependencies.intro" ) ); - tableHeader( new String[]{"GroupId", "ArtifactId", "Version"} ); + String groupId = getBundle( locale ).getString( "report.dependencies.column.groupId" ); + + String artifactId = getBundle( locale ).getString( "report.dependencies.column.artifactId" ); + + String version = getBundle( locale ).getString( "report.dependencies.column.version" ); + + tableHeader( new String[]{groupId, artifactId, version} ); for ( Iterator i = model.getDependencies().iterator(); i.hasNext(); ) { @@ -182,6 +191,10 @@ public class DependenciesReport endSection(); } + } + private static ResourceBundle getBundle( Locale locale ) + { + return ResourceBundle.getBundle("project-info-report", locale, DependenciesReport.class.getClassLoader() ); } } diff --git a/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties b/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties index 485e457a35..fee10a8e95 100644 --- a/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties +++ b/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_en.properties @@ -1,3 +1,11 @@ +report.dependencies.name=Dependencies +report.dependencies.nolist=There are no dependencies for this project. It is a standalone application that does not depend on any other project. +report.dependencies.title=Project Dependencies +report.dependencies.description=This document lists the projects dependencies and provides information on each dependency. +report.dependencies.intro=The following is a list of dependencies for this project. These dependencies are required to compile and run the application: +report.dependencies.column.groupId=GroupId +report.dependencies.column.artifactId=ArtifactId +report.dependencies.column.version=Version 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 diff --git a/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties b/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties index b08d06af08..667a23fec7 100644 --- a/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties +++ b/maven-reports/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties @@ -1,3 +1,11 @@ +report.dependencies.name=Dépendances +report.dependencies.nolist=Il n'y a aucune dépendance pour ce projet. C'est une application autonome qui ne dépend d'aucun autre projet. +report.dependencies.title=Dépendances du projet +report.dependencies.description=Ce document liste les dépendances du projet et fournit les informations sur chaque dépendance. +report.dependencies.intro= Ce qui suit est la liste de dépendances pour ce projet. Ces dépendances sont requises pour compiler et exécuter l'application : +report.dependencies.column.groupId=GroupId +report.dependencies.column.artifactId=ArtifactId +report.dependencies.column.version=Version 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