Update docs for use SS and SNS methods

This commit is contained in:
BrunoMine 2017-07-16 12:58:35 -03:00
parent ee8ea4b5ff
commit 4e848b03a9
1 changed files with 9 additions and 1 deletions

View File

@ -9,7 +9,7 @@ boilerplate code in files needing localization:
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S, NS, SS, SNS = dofile(MP.."/intllib.lua")
You will also need to optionally depend on intllib, to do so add `intllib?`
to an empty line in your `depends.txt`. Also note that if intllib is not
@ -36,6 +36,14 @@ string to be translated has singular and plural forms. For example:
-- The second `count` is the actual replacement.
print(NS("You have one item.", "You have @1 items.", count, count))
The `SS` and `SNS` are equivalent to `S` and `SNS` respectively,
but the first argument is the selected language code. If not find it,
works the same as `S` or `NS` normally.
-- The `"es"` is a language code
print(SS("es", "You are welcome.")
print(SNS("es", "You have one item.", "You have @1 items.", count, count))
## Generating and updating catalogs
This is the basic workflow for working with [gettext][gettext]