From 4e177daa2d70f14698bab94ab9a6790cff5d31d7 Mon Sep 17 00:00:00 2001 From: brett Date: Sat, 21 May 2005 15:10:41 +0000 Subject: [PATCH] PR: MPXDOC-128 Submitted by: Vincent Siveton Reviewed by: Brett Porter, Arnaud Heritier Internationalization support for xdoc. Applied with changes git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@171222 13f79535-47bb-0310-9956-ffa450edef68 --- xdoc/plugin.jelly | 583 +++++++++++---- xdoc/plugin.properties | 43 +- xdoc/project.xml | 13 +- .../apache/maven/xdoc/util/LocaleUtil.java | 152 ++++ xdoc/src/plugin-resources/navigation.jelly | 146 ++-- xdoc/src/plugin-resources/site.jsl | 700 ++++++++++++------ .../plugin-resources/templates/cvs-usage.xml | 274 +++---- .../templates/dependencies.xml | 106 +-- .../templates/issue-tracking.xml | 29 +- .../plugin-resources/templates/mail-lists.xml | 107 +-- .../templates/maven-reports.xml | 117 ++- .../templates/project-info.xml | 164 ++-- .../plugin-resources/templates/scm/cvs.xml | 192 ++--- .../plugin-resources/templates/team-list.xml | 313 ++++---- .../templates/templates.properties | 154 ++++ .../templates/templates_de.properties | 153 ++++ .../templates/templates_fr.properties | 156 ++++ xdoc/src/plugin-test/maven.xml | 5 + xdoc/src/plugin-test/test03/maven.xml | 76 ++ .../src/plugin-test/test03/project.properties | 23 + xdoc/src/plugin-test/test03/project.xml | 36 + .../xdocs/images/apache-maven-project.png | Bin 0 -> 22088 bytes .../plugin-test/test03/xdocs/images/maven.gif | Bin 0 -> 1757 bytes .../plugin-test/test03/xdocs/myfile_i18n.xml | 36 + .../test03/xdocs/navigation-pdf.xml | 36 + .../plugin-test/test03/xdocs/navigation.xml | 48 ++ .../xdocs/subdir/subdir2/testjsltosite.xml | 36 + .../xdocs/subdir/subdir2/testjsltosite2.xml | 36 + .../test03/xdocs/subdir/testjsltosite.xml | 38 + .../plugin-test/test03/xdocs/xdocs.properties | 18 + .../test03/xdocs/xdocs_fr.properties | 18 + xdoc/src/plugin-test/test04/maven.xml | 76 ++ .../src/plugin-test/test04/project.properties | 24 + xdoc/src/plugin-test/test04/project.xml | 36 + .../xdocs/images/apache-maven-project.png | Bin 0 -> 22088 bytes .../plugin-test/test04/xdocs/images/maven.gif | Bin 0 -> 1757 bytes .../plugin-test/test04/xdocs/myfile_i18n.xml | 36 + .../plugin-test/test04/xdocs/navigation.xml | 44 ++ .../xdocs/subdir/subdir2/testjsltosite2.xml | 36 + .../test04/xdocs/subdir/testjsltosite.xml | 36 + .../plugin-test/test04/xdocs/xdocs.properties | 18 + .../test04/xdocs/xdocs_fr.properties | 18 + .../testDependenciesComment/maven.xml | 3 +- .../maven/xdoc/util/LocaleUtilTest.java | 69 ++ xdoc/xdocs/faq.fml | 8 +- xdoc/xdocs/goals.xml | 17 +- xdoc/xdocs/i18n.xml | 166 +++++ xdoc/xdocs/navigation.xml | 1 + xdoc/xdocs/properties.xml | 101 ++- 49 files changed, 3470 insertions(+), 1027 deletions(-) create mode 100644 xdoc/src/main/org/apache/maven/xdoc/util/LocaleUtil.java create mode 100644 xdoc/src/plugin-resources/templates/templates.properties create mode 100644 xdoc/src/plugin-resources/templates/templates_de.properties create mode 100644 xdoc/src/plugin-resources/templates/templates_fr.properties create mode 100644 xdoc/src/plugin-test/test03/maven.xml create mode 100644 xdoc/src/plugin-test/test03/project.properties create mode 100644 xdoc/src/plugin-test/test03/project.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/images/apache-maven-project.png create mode 100644 xdoc/src/plugin-test/test03/xdocs/images/maven.gif create mode 100644 xdoc/src/plugin-test/test03/xdocs/myfile_i18n.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/navigation-pdf.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/navigation.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/subdir/subdir2/testjsltosite.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/subdir/subdir2/testjsltosite2.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/subdir/testjsltosite.xml create mode 100644 xdoc/src/plugin-test/test03/xdocs/xdocs.properties create mode 100644 xdoc/src/plugin-test/test03/xdocs/xdocs_fr.properties create mode 100644 xdoc/src/plugin-test/test04/maven.xml create mode 100644 xdoc/src/plugin-test/test04/project.properties create mode 100644 xdoc/src/plugin-test/test04/project.xml create mode 100644 xdoc/src/plugin-test/test04/xdocs/images/apache-maven-project.png create mode 100644 xdoc/src/plugin-test/test04/xdocs/images/maven.gif create mode 100644 xdoc/src/plugin-test/test04/xdocs/myfile_i18n.xml create mode 100644 xdoc/src/plugin-test/test04/xdocs/navigation.xml create mode 100644 xdoc/src/plugin-test/test04/xdocs/subdir/subdir2/testjsltosite2.xml create mode 100644 xdoc/src/plugin-test/test04/xdocs/subdir/testjsltosite.xml create mode 100644 xdoc/src/plugin-test/test04/xdocs/xdocs.properties create mode 100644 xdoc/src/plugin-test/test04/xdocs/xdocs_fr.properties create mode 100644 xdoc/src/test/org/apache/maven/xdoc/util/LocaleUtilTest.java create mode 100644 xdoc/xdocs/i18n.xml diff --git a/xdoc/plugin.jelly b/xdoc/plugin.jelly index 59df28ba..0d1a04e5 100644 --- a/xdoc/plugin.jelly +++ b/xdoc/plugin.jelly @@ -1,4 +1,4 @@ - + @@ -67,7 +67,7 @@ - + @@ -179,7 +179,6 @@ prettyPrint="${prettyPrint}"/> - - - - - - + + + + - - ${title} - -
-

${preamble}

- -
- -
-
+ + ${title} + +
+

${preamble}

+ + + +
+ +
+ @@ -260,8 +260,66 @@
- + + + + ${defaultLocale} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -282,102 +340,150 @@ - - - - - - - - - ${maven_xdoc_xml_copy_pattern} - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + + + + + + + + + + + ${maven_xdoc_xml_copy_pattern} + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - Generating ${outFile} from ${file} - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + Generating ${outFile} from ${file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + Start to grab the current class loader ${currentClassLoader} + + ${currentClassLoader.addURL(dirResource.toURL())} + + + + + + ${context.setClassLoader(foreheadClassLoader)} + + + + + + + + Start to ungrab the current class loader ${currentClassLoader} + ${context.setClassLoader(currentClassLoader.getParent())} + @@ -446,16 +584,86 @@ description="Generate html project documentation xdoc sources"/> - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + java.lang.reflect.InvocationTargetException + Caused by: org.apache.maven.xdoc.util.LocaleUtil.codesToLocales(java.lang.String) + ${ex.getCause().getTargetException().getMessage()} + + + + + + + defaultLocale=[${defaultLocale}] + + locale_supported=[${locale}] + + + + + + + + + + + + + + + + + + + + + + Generating xdocs from POM ... @@ -512,9 +720,35 @@ Unknown report format for report [${pomDocument}]. - + + + + + + + + + + + + + + + + + + @@ -548,7 +782,6 @@ - - + @@ -616,14 +849,43 @@ + + + + + + + + - Copying user supplied resources. @@ -635,15 +897,50 @@ + - + + + + + + + + + + + + + + + + + + + + + @@ -652,8 +949,7 @@ - - + @@ -683,12 +979,7 @@ prereqs="xdoc:init" description="Generate html project documentation xdoc sources"> - - - - - - + + @@ -713,17 +1007,19 @@ - + + + + + - - - @@ -766,7 +1061,6 @@ - @@ -796,11 +1090,10 @@ Transforming user supplied documentation. - - + + - - + + description="Allows the LinkCheck plugin to xdoc a single directory"> + + + + + + + diff --git a/xdoc/plugin.properties b/xdoc/plugin.properties index df0d0084..5d98dab1 100644 --- a/xdoc/plugin.properties +++ b/xdoc/plugin.properties @@ -40,18 +40,6 @@ maven.xdoc.legend=true # NOTE: In the future this information will be described in the POM maven.xdoc.distributionType=jar -# -# DATE Preferences -# - -# The place of the date on the pages : choices are 'bottom', 'left', 'right', 'navigation-top', 'navigation-bottom' -maven.xdoc.date = - -maven.xdoc.date.format = dd MMMM yyyy - -# The date locale -maven.xdoc.date.locale = en - # The default logo to show on the generated site. maven.xdoc.poweredby.image=maven-button-1.png maven.xdoc.poweredby.title=Built by Maven @@ -88,3 +76,34 @@ maven.xdoc.projectInfo = cvs-usage.xml,\ maven.xdoc.copy.excludes=file.gif,folder-closed.gif,folder-open.gif,icon_alert.gif,icon_alertsml.gif,icon_arrowfolder1_sml.gif,icon_arrowfolder2_sml.gif,icon_arrowmembers1_sml.gif,icon_arrowmembers2_sml.gif,icon_arrowusergroups1_sml.gif,icon_arrowusergroups2_sml.gif,icon_confirmsml.gif,icon_help_lrg.gif,icon_infosml.gif,icon_members_sml.gif,icon_sortleft.gif,icon_sortright.gif,icon_usergroups_sml.gif,icon_waste_lrg.gif,icon_waste_sml.gif,none.png,nw_maj.gif,nw_maj_hi.gif,nw_med.gif,nw_med_hi.gif,nw_med_rond.gif,nw_min.gif,nw_min_036.gif,nw_min_hi.gif,poweredby_036.gif,product_logo.gif,se_maj_rond.gif,sw_min.gif,logos/** # Files not copied unless skin is classic maven.xdoc.copy.excludes.classic=external-classic.png,help_logo.gif,icon_arrowfolderclosed1_sml.gif,icon_arrowwaste1_sml.gif,icon_arrowwaste2_sml.gif,icon_doc_lrg.gif,icon_doc_sml.gif,icon_error_lrg.gif,icon_folder_lrg.gif,icon_folder_sml.gif,icon_help_sml.gif,icon_info_lrg.gif,icon_members_lrg.gif,icon_sortdown.gif,icon_sortup.gif,icon_success_lrg.gif,icon_usergroups_lrg.gif,icon_arrowfolderopen2_sml.gif,icon_warning_lrg.gif,newwindow-classic.png,nw_maj_rond.gif,strich.gif,sw_maj_rond.gif,sw_med_rond.gif + +# +# I18N Preferences +# + +# NOTE: Only used for the default language +# The place of the date on the pages : choices are 'bottom', 'left', 'right', 'navigation-top', 'navigation-bottom' +maven.xdoc.date= +maven.xdoc.date.format=dd MMMM yyyy +# The date locale +maven.xdoc.date.locale=en + +# The default locale (if null, it is the default locale for this instance of the Java Virtual Machine) +# By default it is en to ensure backward compatible +maven.xdoc.locale.default=en +# A comma separated of locales supported by the project +maven.xdoc.locale.supported= + +# Should be in ${maven.docs.src} directory +maven.xdoc.bundle.src=${maven.docs.src} +# NOT CLEAN: we need to copy ${maven.docs.src}/xdocs.properties to +# ${user.home}\.maven\cache\maven-xdoc-plugin-XXX\plugin-resources\temp\${maven.xdoc.bundle}.properties +maven.xdoc.bundle=xdocs + +# If true, display the default language with [defaultLocale.byDefault] +# Ex: English [By default] +maven.xdoc.ui.displayByDefault=false +# If true, display the maven.xdoc.locale.list property as an HTML + + + + + + + ${displayLocale} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${displayLocale} + +
  • + + + + + + + +
  • +
    +
    + + + + + + + ${file} + ${maven.xdoc.poweredby.image} + ${maven.xdoc.poweredby.title} + + + + ${maven.xdoc.poweredby.title} + + + + +
    : ${build.date}
    +
    +
    + + + + + +
    +
    + +
    +
    +

    + + + + - - -
    - -
    - - - -
    -
    - -
    -
    -

    - - - - - - + + - +
    + + + + + + + + + + + + + + + + + + + + @@ -298,6 +475,26 @@
    + + + + + + + + + + + + + + + + + + + + @@ -306,7 +503,7 @@
    - +
    @@ -356,7 +553,7 @@ - + @@ -377,8 +574,7 @@ - - + @@ -387,16 +583,35 @@  >  - + + + + + + + + + + + + + + + + + + + + @@ -417,6 +632,23 @@ + + + + + + + + + + + + + + + + + @@ -441,7 +673,7 @@ -