From 4e848b03a99b3a2c76e82ab895fd6a429d5e1a47 Mon Sep 17 00:00:00 2001 From: BrunoMine Date: Sun, 16 Jul 2017 12:58:35 -0300 Subject: [PATCH] Update docs for use SS and SNS methods --- doc/developer.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/developer.md b/doc/developer.md index 551f188..15c0d53 100644 --- a/doc/developer.md +++ b/doc/developer.md @@ -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]