Doubt about the Vaadin App Foundation i18N Module

Hi all!

Im wanna use the Vaadin Foundation i18n module, but I have a doubt about the XML Syntax.

For example:


<tu tuid="GENERIC_USERNAME">
        <tuv lang="en">
                <seg>Username</seg>
        </tuv>
        <tuv lang="fi">
                <seg>Käyttäjätunnus</seg>
        </tuv>
        <tuv lang="se">
                <seg>Användarnamn</seg>
        </tuv>
</tu>

How can I create a Translation variant for specific terms of language for different countries?

Im on Brasil, and the portuguese here, is different from Portugal, for example…

So, can I use a tuv like that?


<tu tuid="GENERIC_USERNAME">
        <tuv lang="en">
                <seg>Username</seg>
        </tuv>
        <tuv lang="fi">
                <seg>Käyttäjätunnus</seg>
        </tuv>
        <tuv lang="se">
                <seg>Användarnamn</seg>
        </tuv>
        <tuv lang="pt-BR">
                <seg>Nome de Usuário</seg>
        </tuv>
</tu>

Many thanks by attention!

You are absolutely correct, that this is currently a limitation and it needs to be fixed. I’ve filed
a task
to fix the issue. Meanwhile, a workaround is to make your own Lang helper class which calls the InternationalizationServlet’s getMessage() method using the entire locale, no other changes should be needed.


public class Lang {
   ...
   public static String getMessage(String identifier, Object... o) {
         return InternationalizationServlet.getMessage(locale.toString(), identifier, o);
   }
   ...
}