You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2018/11/22 08:29:54 UTC

[myfaces-tobago] branch master updated (42d97d1 -> 45ae1ca)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from 42d97d1  update Versions for tobago-vm
     new b856a7f  TOBAGO-1956: Cleaning localization in the demo
     new 00446c7  update workflow
     new 45ae1ca  TOBAGO-1956: Cleaning localization in the demo

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tobago/example/demo/BundleController.java      | 60 ++++++++++++++++++
 .../myfaces/tobago/example/demo/BundleEntry.java   | 30 +++++++++
 .../myfaces/tobago/example/demo/LocaleChanged.java |  4 ++
 .../tobago/example/demo/LocaleController.java      | 24 +++++++-
 .../myfaces/tobago/example/demo/Outcome.java       |  2 +
 .../tobago/example/demo/DemoBundle.properties      | 60 +-----------------
 ...ndle_de.properties => DemoBundle_de.properties} |  0
 ...e_AT.properties => DemoBundle_de_AT.properties} |  0
 ...e_CH.properties => DemoBundle_de_CH.properties} |  0
 ...e_DE.properties => DemoBundle_de_DE.properties} |  0
 ...ndle_en.properties => DemoBundle_en.properties} |  0
 ...n_GB.properties => DemoBundle_en_GB.properties} |  0
 ...n_US.properties => DemoBundle_en_US.properties} |  0
 ...ndle_es.properties => DemoBundle_es.properties} |  0
 ...ndle_ja.properties => DemoBundle_ja.properties} |  0
 ...a_JP.properties => DemoBundle_ja_JP.properties} |  0
 ...ndle_ru.properties => DemoBundle_ru.properties} |  0
 ...u_RU.properties => DemoBundle_ru_RU.properties} |  0
 ...ndle_zh.properties => DemoBundle_zh.properties} |  0
 ...h_TW.properties => DemoBundle_zh_TW.properties} |  0
 .../example/demo/TranslatedBundle.properties       |  2 -
 .../90-release-checklist/Release_Checklist.xhtml   |  5 ++
 .../content/30-concept/14-locale/Locale.xhtml      | 72 ++++++++++++++++++----
 23 files changed, 183 insertions(+), 76 deletions(-)
 create mode 100644 tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleController.java
 create mode 100644 tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleEntry.java
 create mode 100644 tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleChanged.java
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_de.properties => DemoBundle_de.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_de_AT.properties => DemoBundle_de_AT.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_de_CH.properties => DemoBundle_de_CH.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_de_DE.properties => DemoBundle_de_DE.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_en.properties => DemoBundle_en.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_en_GB.properties => DemoBundle_en_GB.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_en_US.properties => DemoBundle_en_US.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_es.properties => DemoBundle_es.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_ja.properties => DemoBundle_ja.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_ja_JP.properties => DemoBundle_ja_JP.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_ru.properties => DemoBundle_ru.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_ru_RU.properties => DemoBundle_ru_RU.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_zh.properties => DemoBundle_zh.properties} (100%)
 rename tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/{TranslatedBundle_zh_TW.properties => DemoBundle_zh_TW.properties} (100%)
 delete mode 100644 tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle.properties


[myfaces-tobago] 02/03: update workflow

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 00446c7943f504d99e3fd77a05a2d5599326a51b
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Nov 21 18:00:53 2018 +0100

    update workflow
---
 .../content/10-intro/90-release-checklist/Release_Checklist.xhtml    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/90-release-checklist/Release_Checklist.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/90-release-checklist/Release_Checklist.xhtml
index 18d181c..089f78b 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/90-release-checklist/Release_Checklist.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/90-release-checklist/Release_Checklist.xhtml
@@ -174,6 +174,11 @@ $ mvn deploy -Papache-release,generate-assembly --no-plugin-updates -Dnon-defaul
 $ mvn release:perform
 </code></pre>
           </li>
+          <li>Make public available:
+
+            <pre><code class="language-bash">$ git push
+</code></pre>
+          </li>
         </ul>
       </tc:section>
 


[myfaces-tobago] 03/03: TOBAGO-1956: Cleaning localization in the demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 45ae1ca16b763795cb3270c5b57d8412aa9dfd28
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Nov 22 09:29:12 2018 +0100

    TOBAGO-1956: Cleaning localization in the demo
    
    * info page to show current translations
---
 .../tobago/example/demo/BundleController.java      | 60 ++++++++++++++++++++++
 .../myfaces/tobago/example/demo/BundleEntry.java   | 30 +++++++++++
 .../myfaces/tobago/example/demo/LocaleChanged.java |  4 ++
 .../tobago/example/demo/LocaleController.java      | 11 +++-
 .../content/30-concept/14-locale/Locale.xhtml      | 41 ++++++++++++++-
 5 files changed, 144 insertions(+), 2 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleController.java
new file mode 100644
index 0000000..2412202
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleController.java
@@ -0,0 +1,60 @@
+package org.apache.myfaces.tobago.example.demo;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
+import javax.inject.Named;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import static org.apache.myfaces.tobago.util.ResourceUtils.TOBAGO_RESOURCE_BUNDLE;
+
+@Named
+@SessionScoped
+public class BundleController implements Serializable {
+
+  private List<BundleEntry> resources = new ArrayList<>();
+  private List<BundleEntry> messages = new ArrayList<>();
+
+  public void clear(@Observes LocaleChanged event) {
+    resources.clear();
+    messages.clear();
+  }
+
+  public List<BundleEntry> getResources() {
+    if (resources.size() == 0) {
+      final FacesContext facesContext = FacesContext.getCurrentInstance();
+      final ResourceBundle bundle =
+          facesContext.getApplication().getResourceBundle(facesContext, TOBAGO_RESOURCE_BUNDLE);
+      final Enumeration<String> keys = bundle.getKeys();
+      while (keys.hasMoreElements()) {
+        final String key = keys.nextElement();
+        resources.add(new BundleEntry(key, bundle.getString(key)));
+      }
+    }
+    return resources;
+  }
+
+  public List<BundleEntry> getMessages() {
+    if (messages.size() == 0) {
+      final FacesContext facesContext = FacesContext.getCurrentInstance();
+      final Application application = facesContext.getApplication();
+      final String bundleName = application.getMessageBundle();
+      final Locale locale = facesContext.getViewRoot() != null
+          ? facesContext.getViewRoot().getLocale() : application.getDefaultLocale();
+      ResourceBundle bundle = ResourceBundle.getBundle(bundleName, locale);
+      final Enumeration<String> keys = bundle.getKeys();
+      while (keys.hasMoreElements()) {
+        final String key = keys.nextElement();
+        messages.add(new BundleEntry(key, bundle.getString(key)));
+      }
+    }
+    return messages;
+  }
+
+}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleEntry.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleEntry.java
new file mode 100644
index 0000000..c146b80
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/BundleEntry.java
@@ -0,0 +1,30 @@
+package org.apache.myfaces.tobago.example.demo;
+
+import java.io.Serializable;
+
+public class BundleEntry implements Serializable {
+
+  private String key;
+  private String value;
+
+  public BundleEntry(String key, String value) {
+    this.key = key;
+    this.value = value;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public void setKey(String key) {
+    this.key = key;
+  }
+
+  public String getValue() {
+    return value;
+  }
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleChanged.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleChanged.java
new file mode 100644
index 0000000..c38a3f2
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleChanged.java
@@ -0,0 +1,4 @@
+package org.apache.myfaces.tobago.example.demo;
+
+public class LocaleChanged {
+}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
index 34d5ca0..bf3aeb5 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
@@ -19,16 +19,19 @@
 
 package org.apache.myfaces.tobago.example.demo;
 
+import org.apache.myfaces.tobago.internal.util.ObjectUtils;
 import org.apache.myfaces.tobago.internal.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.faces.application.Application;
 import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Event;
+import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.servlet.ServletContext;
 import java.io.Serializable;
@@ -47,6 +50,9 @@ public class LocaleController implements Serializable {
 
   private Locale locale;
 
+  @Inject
+  private Event<LocaleChanged> events;
+
   public LocaleController() {
 
     final FacesContext facesContext = FacesContext.getCurrentInstance();
@@ -149,6 +155,9 @@ public class LocaleController implements Serializable {
   }
 
   public void setLocale(final Locale locale) {
+    if (!ObjectUtils.equals(this.locale , locale)) {
+      events.fire(new LocaleChanged());
+    }
     this.locale = locale;
   }
 
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
index 6ffcb56..cae2b9c 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
@@ -18,9 +18,10 @@
 -->
 
 <ui:composition template="/main.xhtml"
+                xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
-                xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
+                xmlns:f="http://java.sun.com/jsf/core">
 
   Tobago supports internationalization and localization.
   <ul>
@@ -54,4 +55,42 @@
     The image url will be evaluated by the Java Bean  <code>LocaleController</code>.
   </p>
 
+  <tc:tabGroup>
+    <tc:tab label="Tobago Resource Bundle">
+      <p>
+      Tobago comes with a resource bundle
+      <code>org.apache.myfaces.tobago.context.TobagoResourceBundle</code> mapped to
+      <code>tobagoResourceBundle</code>.
+      This bundle contails translated text fragments used by Tobago e. g.
+      for label of components.
+      It's easy to expand this bundle to support more languages.
+      </p>
+      <p>
+        The next table shows the keys and the translation with the locale of the current session.
+        The locale can be changed with the selector above.
+      </p>
+      <tc:sheet var="entry" value="#{bundleController.resources}" markup="small">
+        <tc:style maxHeight="500px"/>
+        <tc:column label="Key" sortable="true">
+          <tc:out value="#{entry.key}" labelLayout="skip"/>
+        </tc:column>
+        <tc:column label="Value" sortable="true">
+          <tc:out value="#{entry.value}" labelLayout="skip"/>
+        </tc:column>
+      </tc:sheet>
+    </tc:tab>
+    <tc:tab label="Tobago Message Bundle">
+      Tobago comes with a message bundle for Tobago specific (info/warn/error) messages.
+      <tc:sheet var="entry" value="#{bundleController.messages}" markup="small">
+        <tc:style maxHeight="500px"/>
+        <tc:column label="Key" sortable="true">
+          <tc:out value="#{entry.key}" labelLayout="skip"/>
+        </tc:column>
+        <tc:column label="Value" sortable="true">
+          <tc:out value="#{entry.value}" labelLayout="skip"/>
+        </tc:column>
+      </tc:sheet>
+    </tc:tab>
+  </tc:tabGroup>
+
 </ui:composition>


[myfaces-tobago] 01/03: TOBAGO-1956: Cleaning localization in the demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit b856a7fdd23239b7eb9345304e759e66725c9378
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Nov 21 18:00:41 2018 +0100

    TOBAGO-1956: Cleaning localization in the demo
    
    * renaming bundle and bugfixing
---
 .../tobago/example/demo/LocaleController.java      | 15 ++++--
 .../myfaces/tobago/example/demo/Outcome.java       |  2 +
 .../tobago/example/demo/DemoBundle.properties      | 60 +---------------------
 ...ndle_de.properties => DemoBundle_de.properties} |  0
 ...e_AT.properties => DemoBundle_de_AT.properties} |  0
 ...e_CH.properties => DemoBundle_de_CH.properties} |  0
 ...e_DE.properties => DemoBundle_de_DE.properties} |  0
 ...ndle_en.properties => DemoBundle_en.properties} |  0
 ...n_GB.properties => DemoBundle_en_GB.properties} |  0
 ...n_US.properties => DemoBundle_en_US.properties} |  0
 ...ndle_es.properties => DemoBundle_es.properties} |  0
 ...ndle_ja.properties => DemoBundle_ja.properties} |  0
 ...a_JP.properties => DemoBundle_ja_JP.properties} |  0
 ...ndle_ru.properties => DemoBundle_ru.properties} |  0
 ...u_RU.properties => DemoBundle_ru_RU.properties} |  0
 ...ndle_zh.properties => DemoBundle_zh.properties} |  0
 ...h_TW.properties => DemoBundle_zh_TW.properties} |  0
 .../example/demo/TranslatedBundle.properties       |  2 -
 .../content/30-concept/14-locale/Locale.xhtml      | 35 ++++++++-----
 19 files changed, 37 insertions(+), 77 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
index c656add..34d5ca0 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/LocaleController.java
@@ -24,7 +24,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.faces.application.Application;
-import javax.faces.bean.SessionScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
@@ -62,9 +63,17 @@ public class LocaleController implements Serializable {
 
   public String submit() {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("invoke!!!");
+      LOG.debug("submit locale");
+    }
+    final FacesContext facesContext = FacesContext.getCurrentInstance();
+    final UIViewRoot viewRoot = facesContext.getViewRoot();
+    if (viewRoot != null) {
+      return viewRoot.getViewId();
+    } else {
+      facesContext.addMessage(null,
+          new FacesMessage(FacesMessage.SEVERITY_WARN, "ViewRoot not found!", null));
+      return Outcome.CONCEPT_LOCALE.toString();
     }
-    return null;
   }
 
 // ///////////////////////////////////////////// logic
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Outcome.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Outcome.java
index d6becc5..1e06683 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Outcome.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Outcome.java
@@ -7,6 +7,8 @@ public enum Outcome {
 
   CONCEPT_SECURITY_ROLES_XLOGIN(
       "/content/30-concept/80-security/20-roles/x-login.xhtml?faces-redirect=true"),
+  CONCEPT_LOCALE(
+      "/content/30-concept/14-locale/Locale.xhtml"),
   COMPONENT_COMPONENT(
       "/content/20-component/Component.xhtml?faces-redirect=true"),
   TEST_BUTTONLINK_XACTION(
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle.properties
index 8df8673..4263856 100644
--- a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle.properties
+++ b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle.properties
@@ -1,58 +1,2 @@
-#Converted from 'tobago-example/tobago-example-demo/src//main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml'
-#Thu Sep 20 19:43:06 CEST 2018
-
-form_text1=<li>Values in the first form are being
-  stored temporarily by submitting the second form while the value in the second
-  form is written into the model.</li>
-<li>By submitting both form each value is stored into
-  the model.</li>
-<li>If the first input contains an error but the second
-  one validates, the validation of the first form is deactivated.</li>
-  
-tab_text=The tab control provides so called tab panels.
-    <ul>
-    <li>Control can take place on server- or clientside.</li>
-    <li>Tab controls can be nested.</li>
-    <li>Inside each tab control any other controls   can be used.</li>
-    </ul>
-  
-theme_text=Tobago supports a big variety of displaying controls,
-  so called designs or themes.
-    <ul>
-    <li>Choosing of themes can be application wide,   user or group specific.</li>
-    <li>Images and other resources can be theme   dependant as well as the application pages can be designed seperatly   for each supported theme.</li>
-    </ul>
-
-themesCodeExample=...
-<tobago-config>
-    \u00A0       <theme-config>
-    \u00A0           \u00A0       <default-theme>speyside</default-theme>
-    \u00A0       </theme-config>
-    \u00A0       <resource-dir>tobago</resource-dir>
-</tobago-config>
-...
-
-themesText1=\
-  <b>Theme configuration</b> <br /><br
-    />
-    In Tobago it's easy to give an application a well designed look. You can use
-    prepared themes like speyside or scarborough, just to name two.
-    The only thing you have to do is configure them at the right place. This is
-    done in the tobago-config.xml by defining a default theme.
-
-toolbar_text1=\
-  Toolbars can be used for context sensitive actions inside box controls.
-<ul>
-<li>Toolbars can consist of images, text or both.</li>
-<li>Toolbars can be completly integrated into a box header.</li>
-<li>Actions can be displayed as drop down menues.</li>
-</ul>
-  
-validation_text=\
-  Tobago provides easy to use possibilities for validation of user input.
-    <ul>
-    <li>Syntactic and semantic validation is available.</li>
-    <li>Error messages can be positioned anywhere in the   user interface.</li>
-    <li>Input elements, which are affected by the   validation can be highlighted.</li>
-    </ul>
-
+locale_short=default
+not_translated=Some content of the demo is not translated!
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_AT.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_AT.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_AT.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_AT.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_CH.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_CH.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_CH.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_CH.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_DE.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_DE.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_de_DE.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_de_DE.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en_GB.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en_GB.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en_GB.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en_GB.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en_US.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en_US.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_en_US.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_en_US.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_es.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_es.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_es.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_es.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ja.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ja.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ja.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ja.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ja_JP.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ja_JP.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ja_JP.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ja_JP.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ru.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ru.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ru.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ru.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ru_RU.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ru_RU.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_ru_RU.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_ru_RU.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_zh.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_zh.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_zh.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_zh.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_zh_TW.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_zh_TW.properties
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle_zh_TW.properties
rename to tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/DemoBundle_zh_TW.properties
diff --git a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle.properties b/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle.properties
deleted file mode 100644
index 4263856..0000000
--- a/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/TranslatedBundle.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-locale_short=default
-not_translated=Some content of the demo is not translated!
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
index 7f941f7..6ffcb56 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/14-locale/Locale.xhtml
@@ -20,7 +20,7 @@
 <ui:composition template="/main.xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
-                xmlns:f="http://java.sun.com/jsf/core">
+                xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
 
   Tobago supports internationalization and localization.
   <ul>
@@ -29,22 +29,29 @@
     <li>Like content, images and scripts can be localized.</li>
   </ul>
 
-  <tc:out value="#{translatedBundle.not_translated}"/>
+  <tc:out value="#{demoBundle.not_translated}"/>
 
-  (Current problem: this value is one request behind!)
-  <tc:out label="Short" value="#{translatedBundle.locale_short}"/>
-
-  <tc:image value="#{request.contextPath}#{localeController.imageCountryName}">
-    <tc:style width="100px" height="100px"/>
-  </tc:image>
-
-  <tc:selectOneChoice value="#{localeController.locale}"
-                      label="Locale">
+  <tc:selectOneChoice value="#{localeController.locale}" label="Locale">
     <f:selectItems value="#{localeController.localeItems}"/>
+    <tc:event action="#{localeController.submit}"/>
   </tc:selectOneChoice>
 
-  <tc:flowLayout textAlign="right">
-    <tc:button action="#{localeController.submit}" label="Submit"/>
-  </tc:flowLayout>
+  <tc:in label="ISO 639 / 3166" value="#{demoBundle.locale_short}" readonly="true"/>
+
+  <p>
+    The localization of JSF works with Java resource bundles.
+    These bundles needs to be definded in the <code>faces-config.xml</code> under the
+    section <code>&lt;resource-bundle&gt;</code>.
+  </p>
+
+  <p>
+    <tc:image value="#{request.contextPath}#{localeController.imageCountryName}">
+      <tc:style width="100px" height="100px"/>
+    </tc:image>
+  </p>
+
+  <p>
+    The image url will be evaluated by the Java Bean  <code>LocaleController</code>.
+  </p>
 
 </ui:composition>