[cai18n-dev] [GIT] Compiler assisted internalization library branch, master, updated. c0d26e1af985ee4212fc38b341dd624ced42b7b3

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Aug 26 16:38:33 CEST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Compiler assisted internalization library".

The branch, master has been updated
       via  c0d26e1af985ee4212fc38b341dd624ced42b7b3 (commit)
      from  1e4c54f2cb4f90ed5af9d40afe9573d2dd9f7a76 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=cai18n.git;a=commit;h=c0d26e1af985ee4212fc38b341dd624ced42b7b3
http://github.com/ceki/cai18n/commit/c0d26e1af985ee4212fc38b341dd624ced42b7b3

commit c0d26e1af985ee4212fc38b341dd624ced42b7b3
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Aug 26 16:36:38 2009 +0200

    ongoing work

diff --git a/cai18n-api/src/test/java/ch/qos/cai18n/sample/Countries.java b/cai18n-api/src/test/java/ch/qos/cai18n/sample/Countries.java
index d5c3ca6..8cab228 100644
--- a/cai18n-api/src/test/java/ch/qos/cai18n/sample/Countries.java
+++ b/cai18n-api/src/test/java/ch/qos/cai18n/sample/Countries.java
@@ -21,8 +21,12 @@
  */
 package ch.qos.cai18n.sample;
 
-public enum Countries {
+import ch.qos.cai18n.LocaleNames;
+import ch.qos.cai18n.ResourceBundleName;
 
+ at ResourceBundleName("countries")
+ at LocaleNames({"en", "fr"})
+public enum Countries {
   CH,  // Switzerland (Confederation Helvetique)
   CN,  // China
   FR,  // France
diff --git a/cai18n-api/src/test/resources/ch/qos/cai18n/sample/Countries_en.properties b/cai18n-api/src/test/resources/countries_en.properties
similarity index 100%
rename from cai18n-api/src/test/resources/ch/qos/cai18n/sample/Countries_en.properties
rename to cai18n-api/src/test/resources/countries_en.properties
diff --git a/cai18n-api/src/test/resources/ch/qos/cai18n/sample/Countries_fr.properties b/cai18n-api/src/test/resources/countries_fr.properties
similarity index 100%
rename from cai18n-api/src/test/resources/ch/qos/cai18n/sample/Countries_fr.properties
rename to cai18n-api/src/test/resources/countries_fr.properties
diff --git a/cai18n-site/src/site/pages/manual.html b/cai18n-site/src/site/pages/manual.html
index 7c6060c..c1b515d 100644
--- a/cai18n-site/src/site/pages/manual.html
+++ b/cai18n-site/src/site/pages/manual.html
@@ -40,9 +40,13 @@
    <p>For the sake of argument, assume you wish to internationalize
    color names, in CAI18N you could write a color enum.</p>
 
-   <pre class="prettyprint source">
-package com.foo.somePackage;
+   <pre class="prettyprint source">package com.foo.somePackage;
 
+import ch.qos.cai18n.LocaleNames;
+import ch.qos.cai18n.ResourceBundleName;
+
+ at ResourceBundleName("colors") // mandatory annonation
+ at LocaleNames({"en_UK", "fr"}) // optional list of locale names
 public enum Colors  {
   BLUE,
   RED,
@@ -51,12 +55,13 @@ public enum Colors  {
    
 
   <p>Once you define a few color names, you can create a regular
-  resource bundle named after the Colors enum and its locale. For
-  example, for the UK locale, you would name your resource bundle as
-  <em>Colors_en_UK.properties</em>. It should also be placed in the
-  "com/foo/somePackage" folder of the appropriate jar file.</p>
+  resource bundle named after value of the @ResourceBundleName
+  annotation in Colors and the appropriate locale. For example, for
+  the UK locale, you would name your resource bundle as
+  <em>colors_en_UK.properties</em>. It should also be placed in the
+  root of folder of the appropriate jar file.</p>
 
-  <p>Here is a sample a  <em>Colors_en_UK.properties</em> file:</p>
+  <p>Here is a sample a <em>colors_en_UK.properties</em> file:</p>
 
   <pre class="source">
 BLUE=violets are blue
@@ -64,7 +69,7 @@ RED=roses are red
 GREEN={0} are green  </pre>
 
   <p>For the french locale, the resource bundle would be named
-  <em>Colors_fr.properties</em>. Here are possible contents.</p>
+  <em>colors_fr.properties</em>. Here are possible contents.</p>
 
   <pre class="source">
 BLUE=les violettes sont bleues
@@ -77,7 +82,7 @@ GREEN=les {0} sont verts</pre>
   <p>In your application, you would retreive the localized message as
   follows: </p>
 
-  <pre  class="prettyprint source">// obtain a message convetor for France
+  <pre  class="prettyprint source">// obtain a message conveyor for France
 MessageConveyor mc = new MessageConveyor(Locale.FRANCE);
 
 // use it to retrieve internationalized messages

-----------------------------------------------------------------------

Summary of changes:
 .../test/java/ch/qos/cai18n/sample/Countries.java  |    6 ++++-
 ...tries_en.properties => countries_en.properties} |    0
 ...tries_fr.properties => countries_fr.properties} |    0
 cai18n-site/src/site/pages/manual.html             |   23 ++++++++++++-------
 4 files changed, 19 insertions(+), 10 deletions(-)
 rename cai18n-api/src/test/resources/{ch/qos/cai18n/sample/Countries_en.properties => countries_en.properties} (100%)
 rename cai18n-api/src/test/resources/{ch/qos/cai18n/sample/Countries_fr.properties => countries_fr.properties} (100%)


hooks/post-receive
-- 
Compiler assisted internalization library



More information about the cal10n-dev mailing list