mirror of
https://github.com/minetest-mods/intllib.git
synced 2025-04-28 14:50:45 +02:00
Update docs for use SS and SNS methods
This commit is contained in:
parent
ee8ea4b5ff
commit
4e848b03a9
@ -9,7 +9,7 @@ boilerplate code in files needing localization:
|
|||||||
|
|
||||||
-- Load support for intllib.
|
-- Load support for intllib.
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
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?`
|
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
|
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.
|
-- The second `count` is the actual replacement.
|
||||||
print(NS("You have one item.", "You have @1 items.", count, count))
|
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
|
## Generating and updating catalogs
|
||||||
|
|
||||||
This is the basic workflow for working with [gettext][gettext]
|
This is the basic workflow for working with [gettext][gettext]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user