1
0
mirror of https://github.com/minetest-mods/intllib.git synced 2025-07-07 02:10:24 +02:00
This commit is contained in:
BrunoMine
2021-07-05 05:30:32 -04:00
committed by GitHub
11 changed files with 202 additions and 15 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 `NS` 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]