Page 1 of 1
transplate.lua - Languages support [1.1]
Posted: Tue Nov 01, 2022 3:10 pm
by KateBulka
transplate.lua
So... This is a library you can use to translate strings! Sounds fun, right? Well, it's mostly a library that you should know how to use, but there is plans to integrate library with other libraries. For now transplate.lua works with littleDialogue by MrDoubleA, you can even change fonts for specific/all style(s)!
Library:
1.1 (Current) -
https://pastebin.com/upbGbX5H
1.0 -
https://pastebin.com/5xJVabUN
P.S: I recommend naming file transplate.lua
How to use?:
To switch language you can do this in luna.lua file:
Code: Select all
local transplate = require("transplate")
transplate.setLanguage("Example") -- a language folder should exist with that name!!
You can also switch various settings on the top of library:
For move advanced users: You can get translation of string:
Code: Select all
-- worth mentioning that it returns original text if there is no translation
local translated = transplate.getTranslation(text, lang (by default it's current language))
Bug reports, recommendations and etc are welcome! This library was a bit rushed honestly :)
Re: transplate.lua - Languages support [1.0]
Posted: Sun Nov 06, 2022 12:43 am
by MECHDRAGON777
Out of curiosity, how many languages does this currently support? (Like, if I wanted Japanese, English, and Spanish; would I be able to use this to implement that, or just English and a default specific other language?)
Re: transplate.lua - Languages support [1.0]
Posted: Thu Nov 17, 2022 10:09 am
by KateBulka
MECHDRAGON777 wrote: ↑Sun Nov 06, 2022 12:43 am
Out of curiosity, how many languages does this currently support? (Like, if I wanted Japanese, English, and Spanish; would I be able to use this to implement that, or just English and a default specific other language?)
You have to write your lang files by yourself.
Re: transplate.lua - Languages support [1.1]
Posted: Sat Feb 18, 2023 6:46 am
by KateBulka
1.1 is out!! Now it has integration with Marioman2007's pauseMenu.lua and now it translates answers and speaker names correctly with littleDialogue!!
(Also now it can change graphics depending on language x) )
Download link is in topic <3
Re: transplate.lua - Languages support [1.1]
Posted: Fri May 26, 2023 12:02 pm
by Captain Ben
Should I write global tables to save switched language in luna.lua?