diff --git a/localization.html b/localization.html index 826ca8c..4b304ad 100644 --- a/localization.html +++ b/localization.html @@ -83,6 +83,15 @@ font-style: italic; background-color: #FFFF77; } + dl { + margin-left: 10px; + } + .cond { + background-color: lime; + } + .repl { + background-color: yellow; + } @@ -110,7 +119,7 @@
Language:
) or HTML codes.Something like {0}
in a string is replaced with a certain value, for example in Join #{0}
the {0}
is replaced with the stream name (e.g. resulting in Join #joshimuz
).
Something like {0}
in a string means it is replaced with the number 0
parameter. It should say in a comment what it gets replaced with (although most of the time it's clear from context already).
Replacements use the MessageFormat class, you can read that documentation if you're interested, although mostly it's enough to just stick close to the template. One important thing is that any single quotes need to be escaped with a single quote (e.g. Can''t join ''{0}''
).
Join #{0}
{0}
is joshimuz
turns into Join #joshimuz
The more advanced choice
pattern is commonly used for plurals: Join {0,choice,1#|1<{0} }{0,choice,1#channel|1<channels}
. In this example there are two separate choice patterns ({0,choice,<choices>}
), both using the first parameter (0
), which contains the number of channels:
{0,choice,1#|1<{0} }
outputs the number and a space ({0}
) only if it's greater than one.1#channel
" and "1<channels
", meaning if the parameter is 1 it will be replaced with "channel", if it's 1 or greater it will be replaced with "channels" (the plural). In this case the number should never be 0, so that's not a consideration.Replacements use the MessageFormat class. Mostly it's enough to just stick close to the template.
+ +Important: Any single quote ('
) in a string that contains a replacement needs to be escaped with a single quote (e.g. Can''t join ''{0}''
).
The more advanced {0,choice,<choices>}
pattern is used to decide between two strings depending on the value in the number 0
parameter. This is commonly used to decide between a singular and plural form.
Join {0,choice,1#channel|1<{0} channels}
1#
means "exactly 1" (in which case it chooses channel
1<
means "more than 1" in which case it chooses {0} channels
(where the {0}
is replaced as well){0}
is 1
turns into Join channel
{0}
is 2
turns into Join 2 channels
{0}
is 30
turns into Join 30 channels
{0} {0,choice,1#Hour|1<Hours}
{0}
is 1
turns into 1 Hour
{0}
is 2
turns into 2 Hours
Translations are commited to the repository by myself, since the files have to be converted into the format I want (e.g. proper structure and order of items). The process is mostly automated. It also adds the names of contributors to each language at the top of the file (if you want to be excluded from that or want to appear with a different name, let me know).
+Translations are commited to the repository by myself, since the files have to be converted into the format I want (e.g. proper structure and order of items). The process is mostly automated.
+ +Note: The names of contributors to each language (as registered on POEditor) are added to the top of the language file. If you want to be excluded from that or want to appear with a different name, let me know.
Changes of the original English strings have to be done via GitHub (the normal way via Pull Requests).