You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2008/11/08 18:47:00 UTC

svn commit: r712410 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: .settings/org.eclipse.core.resources.prefs ChangeLog build.xml doc/Translating.txt src/com/ecyrd/jspwiki/Release.java tests/TranslationsCheck.java

Author: jalkanen
Date: Sat Nov  8 09:46:59 2008
New Revision: 712410

URL: http://svn.apache.org/viewvc?rev=712410&view=rev
Log:
Added ant target "i18n-check" and doc/Translating.txt. Also improved TranslationsCheck slightly so that it wraps exceptions neatly.

Added:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/Translating.txt
Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.settings/org.eclipse.core.resources.prefs
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/build.xml
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/TranslationsCheck.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.settings/org.eclipse.core.resources.prefs
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.settings/org.eclipse.core.resources.prefs?rev=712410&r1=712409&r2=712410&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.settings/org.eclipse.core.resources.prefs (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.settings/org.eclipse.core.resources.prefs Sat Nov  8 09:46:59 2008
@@ -1,4 +1,4 @@
-#Thu Nov 06 11:42:05 EET 2008
+#Sat Nov 08 19:15:42 EET 2008
 eclipse.preferences.version=1
 encoding//etc/i18n/templates/default_de.properties=ISO-8859-1
 encoding//src/wikipages/fi/ApprovalRequiredForPageChanges.txt=UTF-8

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=712410&r1=712409&r2=712410&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Sat Nov  8 09:46:59 2008
@@ -1,3 +1,13 @@
+2008-11-06  Janne Jalkanen <ja...@apache.org>
+
+        * 2.8.1-svn-11
+
+        * Added doc/Translating.txt as a guide for people who want to create
+        translations.  
+        
+        * Added ant "i18n-check" target as an interface
+        to TranslationsCheck (no need to get geeky running a Java class).
+
 2008-11-06  Andrew Jaquith <ajaquith AT apache DOT org>
 
         * 2.8.1-svn-10

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/build.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/build.xml?rev=712410&r1=712409&r2=712410&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/build.xml (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/build.xml Sat Nov  8 09:46:59 2008
@@ -1440,6 +1440,17 @@
 	<delete dir="${tmplt.i18n.dir}" />
   </target>
   
+  <target name="i18n-check" depends="compile,compiletests" 
+	      description="Run this target to check whether a translation is up to date.">
+	  	 <input message="Please give the language you want to check translation for (e.g. fi, es, de)"
+	  			addproperty="check.language"/>
+	     <java classname="TranslationsCheck">
+	       <classpath path="${tests.build}"/>
+	       <classpath path="${code.build}"/>
+	       <arg line="${check.language}"/>
+	     </java>
+  </target>
+	
   <target name="api-diff" description="Compares API in JSPWiki.jar with previous version"
     depends="jar">
      <!-- Assumes that the dependencyfinder.dir property points to the

Added: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/Translating.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/Translating.txt?rev=712410&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/Translating.txt (added)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/Translating.txt Sat Nov  8 09:46:59 2008
@@ -0,0 +1,105 @@
+
+How to translate JSPWiki to your language and get away with it?
+===============================================================
+
+JSPWiki translations are in three files, all located in the etc/i18n directory.
+The files are:
+
+* CoreResources.properties - this is the main file for JSPWiki core components
+  (e.g. errors, and that sort of stuff)
+  
+* templates/default.properties - this is the property file for the default template.
+  All other template localizations go into this one as well.
+  
+* plugin/PluginResources.properties - the file where all the JSPWiki core plugins
+  (that is, the ones that ship with JSPWiki) get their translations from.
+  
+You will need to provide all three files.  In addition - if you are very enterprising -
+you can also provide an extra translation (but this is strictly optional):
+the corepages.  They are located under src/wikipages/<language>.
+
+The following is a simple tutorial for creating the files.  However, if you are
+computationally adept, it's a much nicer idea to just copy the default template
+files by hand and send us a patch.
+
+Step 1
+------
+
+Create the necessary template files by running
+
+% ant i18n-create-template
+
+This will ask your language code (e.g. "se" if you wish to make a Swedish translation).
+This code is the standard ISO two-letter language code for your language.  If you want,
+you can also make a language variant version (e.g. "en_AU" for Australian English).
+
+The files will be saved in your current directory, under "i18n_templates/JSPWiki_<language>/"
+
+Step 2
+------
+
+Translate the files.  Do not forget that the property files MUST be in ISO-Latin-1,
+so you may need to use the native2ascii tool to munge the files first.
+
+Step 3
+------
+
+Test the files.  Create a JAR file with
+
+% ant i18n-jar-template
+
+Which will create a build/JSPWiki_se.jar, which you can then put into the classpath of
+a live JSPWiki installation to check.
+
+Please try to be thorough.
+
+Step 4
+------
+
+Contribute the translation back to JSPWiki.  Please go to the Apache issue tracker at
+
+https://issues.apache.org/jira/browse/JSPWIKI
+
+and create a new ticket; then attach the JAR file to the ticket.  Please have a 
+separate zip/JAR file for your wikipages translation; makes them easier to keep
+track of them.  Of course, if you know how, adding a patch is even better!
+
+REMEMBER TO TELL WHICH VERSION OF JSPWIKI YOUR TRANSLATION WAS MADE FOR!
+
+Note: we don't necessarily take in translations for older versions.
+
+Step 5
+------
+
+The most important step of all: Please, please, PLEASE maintain your translation!  Even
+though JSPWiki development is multilingual, we don't know all the languages, so sooner
+or later your translation will be obsolete.
+
+However, we have a nifty tool for checking what needs to be updated in a translation!
+Run
+
+% ant i18n-check
+
+And it will tell you what is obsolete, and what you will need to update.
+
+If you see something that is not up to date or plain wrong, please go again to the 
+Apache issue tracker at
+
+https://issues.apache.org/jira/browse/JSPWIKI
+
+Open a ticket, and attach a patch for your translation. Again, REMEMBER TO TELL WHICH
+VERSION OF JSPWIKI!
+
+Doing a patch is easy - if you use Eclipse, just right-click on the project, and choose
+"Team->Create Patch".  Then attach the patch file to the JIRA issue.
+
+If you have trouble creating a patch, then you can upload the changed files themselves,
+but with two caveats
+
+1) please say that you don't know how to create a patch, and
+2) this is OK only for language translations.
+
+Step 6
+------
+
+Have a cup of coffee and relax.  Relaxations are very important, says Zathras.

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=712410&r1=712409&r2=712410&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java Sat Nov  8 09:46:59 2008
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "10";
+    public static final String     BUILD         = "11";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/TranslationsCheck.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/TranslationsCheck.java?rev=712410&r1=712409&r2=712410&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/TranslationsCheck.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/TranslationsCheck.java Sat Nov  8 09:46:59 2008
@@ -46,27 +46,49 @@
         System.out.println("Internationalization property file differences between 'default en' and '"
                            + suffix + "' following:\n");
 
-        diff("/etc/i18n/CoreResources.properties",
-             "/etc/i18n/CoreResources_" + suffix + ".properties");
-        detectDuplicates("/etc/i18n/CoreResources_" + suffix + ".properties");
-
-        diff("/etc/i18n/templates/default.properties",
-             "/etc/i18n/templates/default_" + suffix + ".properties");
-        detectDuplicates("/etc/i18n/templates/default_" + suffix + ".properties");
-
-        diff("/etc/i18n/plugin/PluginResources.properties",
-             "/etc/i18n/plugin/PluginResources_" + suffix + ".properties");
-        detectDuplicates("/etc/i18n/plugin/PluginResources_" + suffix + ".properties");
+        try
+        {
+            diff("/etc/i18n/CoreResources.properties",
+                 "/etc/i18n/CoreResources_" + suffix + ".properties");
+            detectDuplicates("/etc/i18n/CoreResources_" + suffix + ".properties");
+        }
+        catch( FileNotFoundException e )
+        {
+            System.err.println("Unable to locate "+"/etc/i18n/CoreResources_" + suffix + ".properties");
+        }
+
+        try
+        {
+            diff("/etc/i18n/templates/default.properties",
+                 "/etc/i18n/templates/default_" + suffix + ".properties");
+            detectDuplicates("/etc/i18n/templates/default_" + suffix + ".properties");
+        }
+        catch( FileNotFoundException e )
+        {
+            System.err.println("Unable to locate "+"/etc/i18n/templates/default_" + suffix + ".properties");
+        }    
         
-        System.out.println("Duplicates overall (two or more occurences):");
-        System.out.println("--------------------------------------------");
-        Iterator iter = duplProps.iterator();
-        if (duplProps.size() == 0)
-            System.out.println("(none)");
-        else
-            while (iter.hasNext())
-                System.out.println(iter.next());
-        System.out.println();
+        try
+        {
+            diff("/etc/i18n/plugin/PluginResources.properties",
+                 "/etc/i18n/plugin/PluginResources_" + suffix + ".properties");
+        
+            detectDuplicates("/etc/i18n/plugin/PluginResources_" + suffix + ".properties");
+        
+            System.out.println("Duplicates overall (two or more occurences):");
+            System.out.println("--------------------------------------------");
+            Iterator iter = duplProps.iterator();
+            if (duplProps.size() == 0)
+                System.out.println("(none)");
+            else
+                while (iter.hasNext())
+                    System.out.println(iter.next());
+            System.out.println();
+        }
+        catch( FileNotFoundException e ) 
+        {
+            System.err.println("Unable to locate "+"/etc/i18n/plugin/PluginResources_" + suffix + ".properties");
+        } 
 
         System.out.println("NOTE: Please remember that dependent on the usage of these i18n files, outdated " +
         		"properties maybe should not be deleted, because they may be used by previous releases. " +