Comments (7)
Yes, we can use kaeza's intllib mod for internationalization. Would you be able to add translations?
from technic.
I would like to translate it to Brazilian Portuguese.
from technic.
yes, i can add translations, i have see on mod more ores, it control if mod intllib is loaded and set the function S, else s=function(s) return s
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
every string must be insert in function S
S("string to translate")
S("my param %s "):format(S("param"))
my hint is to use a translation simbol.
for example
S("GOLD")
S("GOLD_DESC")
locale/en.txt
GOLD = gold
GOLD_DESC = gold is a mineral
is redundant, but we can take en.txt for make easy and total translation
locale/it.txt
GOLD = oro
GOLD_DESC = l'oro รจ un minerale
this is importat edit, i want talk before write
from technic.
No, that isn't how intllib is used. It should be used like this:
name = S("Gold")
And then in a translation file:
Gold = Aurum
That way if a translation is not found it returns "Gold" and not "GOLD_NAME".
Your usage of format() is also incorrect, it should be used like this:
S("Electric Furnace %s"):format(percent)
That is, you normally don't translate arguments to format, you just translate it in the original string.
Of course in this case you could just use concatenation, format syntax is more useful when you want to embed strings into the middle of a translation.
format() and concatenation should be used for untranslatable strings like numbers, usually that are dynamic.
I am discussing intllib with kaeza right now, and before we add translation files we will need to have support for it in the code.
from technic.
in your method we must write on terminal this command
grep -o -r 'S("'.*'")' * > locale/en.txt
for search every string to translate.
from technic.
@pagliaccio: With your method, yes. We would then have to translate all of the constants. However if a translation is not found the original string is returned, so you have to use real strings.
from technic.
I have pushed support for intllib. @aracnus and @pagliaccio: You can begin work on your translations. Use locale/template.txt to start. Once you have finished you can pull-request it.
from technic.
Related Issues (20)
- Battery Box does not see network, will not charge. HOT 5
- Battery box does not see network related to issue #614 HOT 2
- No concrete 'moreblocks' HOT 2
- No power working at all HOT 6
- Feature request: Add a machine that generates power from cobblestone HOT 14
- Blunt Chainsaw HOT 3
- chainsaw triggers a on_mods_loaded() error HOT 2
- Quarry unable to mine trough smoke and gas HOT 6
- Feature Request: Add Mineclone2 support HOT 1
- Wood doesn't Grind HOT 5
- Mesecons Dependency should not be Optional
- [Feature Request] Increase Storage Capacity in Mithril Chests HOT 12
- It is impossible to build a nuclear reactor HOT 3
- stainless steel HOT 1
- Sulfur Generation HOT 1
- coppwe plate HOT 2
- No Included copy of the License
- Power Monitors Unstable State
- Desert Stone Dust HOT 2
- Sonic Screwdriver can Rotate Steel Doors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from technic.