... | ... | @@ -147,19 +147,23 @@ Note that parameter substitution and plural form substitution are performed on t |
|
|
|
|
|
### Specifying a Form ###
|
|
|
|
|
|
Some words or phrases may be used in more than one way, and these may require different translations. For example, "Post" may be used as a verb as a button label, while "Post" as a noun could refer to a blog post. These may need to be translated into different words or phrases in another language. Since a translator will be presented with the same word ("Post") in both cases, you may need to give the translator more help in determining how the word will be used. You do this by providing an extra argument following the message string (or array) that indicates the extra data to be shown to the translator. For example
|
|
|
Some words or phrases may be used in more than one way, and these may require different translations. For example, "Post" may be used as a verb as a button label, while "Post" as a noun could refer to a blog post. These may need to be translated into different words or phrases in another language. Since a translator will be presented with the same word ("Post") in both cases, the translator may need more help in determining how the word will be used. Special comments can be used preceding the line containing the `_()` call to inform the translator of any such ambiguities. This may be especially important for short or single-word phrases. The format of the comments has yet to be worked out, but the data will be collected by the program that collects the data for the translation files (see the section on translation files below).
|
|
|
For example
|
|
|
|
|
|
_("pn","Post",{form:"noun"})
|
|
|
// Translation::form: noun
|
|
|
_("pn","Post")
|
|
|
|
|
|
or
|
|
|
|
|
|
_("pv","Post",{form:"verb"})
|
|
|
// Translation::form: verb
|
|
|
_("pv","Post")
|
|
|
|
|
|
Note that the id is different for these two, so there will be two values for the translator; the `form` tells the translator how the word is used. The value for `form` can be anything that will help the translator figure out how best to translate the word, e.g.,
|
|
|
|
|
|
_("pcol","Post",{form:"column name"})
|
|
|
// Translation::form: column name
|
|
|
_("pcol","Post")
|
|
|
|
|
|
In fact, you can supply as much meta-data between the braces as you would like. [I'm not sure yet how this will be used, other than `form`, but it gives flexibility for the future.]
|
|
|
[Additional meta-data could be supplied this way, but I'm not sure what that might be. It's good to be flexible, however, as I suspect we will find that the situation is more complicated once we get some actual languages involved.]
|
|
|
|
|
|
|
|
|
## The Localization Data ##
|
... | ... | |