Page 1 of 1

[LIBRARY] language.lua A simple string manager for localization in pure lua

Posted: Sun Feb 04, 2024 7:24 pm
by alejandroalzate
This is the second contribution to the community, since formatting a nice looking post for viewtopic.php?t=95418 was a pain i will just send you directly to the repositories to take a look the read me that should have enough info about it to get you started, since it's quite simple but saves the chore of making that stack of functions.

Get a copy here:
Github: https://github.com/alejandro-alzate/language-lua
or here:
Luarocks: https://luarocks.org/modules/alejandro-alzate/language

Re: [LIBRARY] language.lua A simple string manager for localization in pure lua

Posted: Sun Feb 04, 2024 9:19 pm
by dusoft
Any new open source library is welcome, so thanks.

I checked it and it seems similar to:
https://github.com/kikito/i18n.lua

Both yours and Kikito's will work great for smaller number of text strings. Once your need is in hundreds to thousands of strings (e.g. adventure game with lots of dialogs etc.), the format gets impractical to work with.

I prefer using POEdit for editing and then gettext or similar for actual translation. Gettext is well tested and offers full support of universal pluralization that works for any language. There are couple of gettext implementations in Lua and Lua with FFI.

Re: [LIBRARY] language.lua A simple string manager for localization in pure lua

Posted: Tue Feb 06, 2024 2:53 pm
by alejandroalzate
dusoft wrote: Sun Feb 04, 2024 9:19 pm I checked it and it seems similar to:
https://github.com/kikito/i18n.lua
Didn't know he had one. dude this guy, zorg, and rxi are the literal pillars of most lua libraries out there :cry:

Re: [LIBRARY] language.lua A simple string manager for localization in pure lua

Posted: Tue Feb 06, 2024 6:05 pm
by GVovkiv
dusoft wrote: Sun Feb 04, 2024 9:19 pm Any new open source library is welcome, so thanks.

I checked it and it seems similar to:
https://github.com/kikito/i18n.lua

Both yours and Kikito's will work great for smaller number of text strings. Once your need is in hundreds to thousands of strings (e.g. adventure game with lots of dialogs etc.), the format gets impractical to work with.

I prefer using POEdit for editing and then gettext or similar for actual translation. Gettext is well tested and offers full support of universal pluralization that works for any language. There are couple of gettext implementations in Lua and Lua with FFI.
There also other good translation systems, such as Fluent https://projectfluent.org/fluent/guide/index.html
And lua implementation of it https://github.com/alerque/fluent-lua/issues, but, sadly, this one seems to be abandoned and not 100% feature completed

Re: [LIBRARY] language.lua A simple string manager for localization in pure lua

Posted: Tue Feb 06, 2024 8:53 pm
by dusoft
GVovkiv wrote: Tue Feb 06, 2024 6:05 pm
dusoft wrote: Sun Feb 04, 2024 9:19 pm Any new open source library is welcome, so thanks.

I checked it and it seems similar to:
https://github.com/kikito/i18n.lua

Both yours and Kikito's will work great for smaller number of text strings. Once your need is in hundreds to thousands of strings (e.g. adventure game with lots of dialogs etc.), the format gets impractical to work with.

I prefer using POEdit for editing and then gettext or similar for actual translation. Gettext is well tested and offers full support of universal pluralization that works for any language. There are couple of gettext implementations in Lua and Lua with FFI.
There also other good translation systems, such as Fluent https://projectfluent.org/fluent/guide/index.html
And lua implementation of it https://github.com/alerque/fluent-lua/issues, but, sadly, this one seems to be abandoned and not 100% feature completed
Nice library, I haven't know about this one. However the lua bindings seem quite limited and yes, it does not seem to be up to date.