If you want to help with translations, please read this guide first.
Nabble uses an XML-based language to map sentences in english to sentences in a foreign language. Let's start with a simple example:
The translation document will have hundreds of tags like the one above. The sentence in english should NOT
be changed, otherwise the system would not know how to make the translation work. You don't have to keep the tags indented or well-aligned, so this would also work:
You can even keep everything in just one line to save space:
<translation><from>New Topic</from><to>Novo Tópico</to></translation>
We actually prefer this collapsed format because it keeps the translation files smaller, but feel free to change the format when you translate the texts to your language.
There are a lot of things you have to pay attention to when you create a new translation file. Let's go through the most important ones.
Please make sure you follow the same punctuation as the sentence in english. For example:
<from>An email has been sent to you.</from>
<to>Um email foi enviado para você.</to>
Note there is a period (dot) at the end of the english sentence, which is also true for the portuguese sentence. Some sentences don't have a period, so you have to pay attention and make sure every sentence is consistent with the english part.
(2) Uppercase and lowercase
You also have to pay special attention to each word in each sentence and make sure your translation follows the uppercase/lowercase pattern. Let's see one example:
<to>Confirme a Senha</to>
Note that both words start with uppercase letters. This is also true for the sentence in portuguese, although it has a lowercase connector that is part of the sentence and thus cannot be removed. Here is another example:
<from>Data successfully saved</from>
<to>Dados salvos com sucesso</to>
Now only the first word of the sentence starts with a capital letter, so the same rule applies to the portuguese sentence. You should understand that the rules of your foreign language must be followed as well.
For example, in German all nouns start with capital letters, so this should always be true in the translation, even if the english sentence doesn't have capital letters at all. In fact, this is another reason we don't force to-lowercase and to-uppercase conversions. So you will probably notice sentences that look pretty similar, but the difference is in the capital letters:
The sentences may have variables that will be replaced later by the system. For example:
In this case, the page number is placed in the sentence. The first thing you must note here is that the variable in the FROM starts with "t." (t.number
) and the variable in the TO starts with "n." (n.number
). This is how our technology was implemented and we will not go into the details for now, so you should only understand this basic difference at this point. You should also understand that the order of words and variables can be changed without problems:
<from>AAA <t.variable/> BBB</from>
<to>AAA BBB <n.variable/></to>
In some cases, the sentence will have tags to build links:
<from>You can try <n.register_link.>registering again</n.register_link.> or contact <n.support_link/>.</from>
<to>Você pode tentar <n.register_link.>registrando-se novamente</n.register_link.> ou entrar em contato com <n.support_link/>.</to>
As you can see, those tags should still be present in the translated sentence and should be used in the same context. Note also that – in this case – all variable tags start with "n." and this is also correct. Since you will receive a file will all sentences in english ready to be translated, the only rule you should remember about this is: variable tags in the translated part (<to>...</to>) should ALWAYS start with "n.".
is a very important topic and should be handled properly. In some languages – like portuguese – nouns, pronouns, adjectives, etc. must be changed based on the words they relate to. For example, in english we have "Your forum" and "Your gallery". The "your" pronoun doesn't change, but in portuguese we have "Seu fórum" and "Sua galeria". Forum is a masculine word and gallery is feminine. So we must change the pronoun accordingly. Since Nabble has sentences like "Create a new forum" and "Create a new gallery", we need some logic to build those sentences correctly in other languages. Here is how we do this for the portuguese language:
<macro name="is_masculine" dot_parameter="noun">
<n.not.regex_matches text="[n.to_lower_case.noun/]" pattern="galeria|mensagem|subcategoria|categoria"/>
The concept of macro above will be explained later when we release the templates feature. In summary, a macro works just like a function that you can call from other tags. In this example, this macro returns TRUE if the "noun" parameter isn't found in the pattern "galeria|mensagem|subcategoria|categoria" (which is a pipe-separated list of feminine words from the Nabble interface). So let's consider the sentence "Congratulations on your new forum!" and "Congratulations on your new gallery!". This is how it looks in practice:
<from>Congratulations on your new <t.app/>!</from>
Note that in the portuguese sentence we use a command called "pelo_seu_novo", which is implemented like this:
<macro name="pelo_seu_novo" dot_parameter="what">
<then>pelo seu novo</then>
<else>pela sua nova</else>
This macro has a parameter called "what" (it is defined as a 'dot' parameter because we want it to be called after a dot). The macro returns "pelo seu novo <n.what/>" if "what" is masculine and "pela sua nova <n.what/>" if "what" is feminine. With this type of logic you can build any sentence in portuguese (at least for what Nabble really needs). If your language has declension, you should create a logic like the one above. We can help you with that, if needed.