Page 1 of 1

How to set up multiple languages ​​on Android

Posted: Tue Feb 06, 2018 12:23 pm
by Trafitto
Hello,
I wanted to know if there is a way to set the multilanguage on Android

Thanks!!

Re: How to set up multiple languages ​​on Android

Posted: Tue Feb 06, 2018 12:31 pm
by zorg
If your question is can you code your app to support multiple languages, then yes, if you code it as such.

Re: How to set up multiple languages ​​on Android

Posted: Tue Feb 06, 2018 4:00 pm
by Trafitto
Ok, so is there nothing already made ? I have to make the folder res/values/strings.xml and handle by myself ?

Re: How to set up multiple languages ​​on Android

Posted: Tue Feb 06, 2018 4:29 pm
by zorg
I think there might be a misconception here, or we're talking about two different things.

Löve works the same on all platforms it supports, Android and iOS included; you have your data in the .love file, which is a renamed zip, and for android, you build an application with that included with the löve app so it runs your own project (or, for development purposes, you just download the plain löve app, and there's a single folder where you can put your code and resources to develop/test).

I found the below link, and i don't think that's needed for whatever you want to accomplish; multi-language support with löve can work in a myriad ways.
http://android.tutorialhorizon.com/what-is-strings-xml/

For example, here's a lib one could use:
https://github.com/kikito/i18n.lua

Re: How to set up multiple languages ​​on Android

Posted: Tue Feb 06, 2018 9:23 pm
by raidho36
You can do something as simple as

Code: Select all

selected_language = "EN"
text = require ( "text/" .. selected_language .. "/dialogue123.lua" )
love.graphics.print ( text.greeting, 100, 100 )
Where the dialogue file returns a Lua table with relevant entries.

Re: How to set up multiple languages ​​on Android

Posted: Wed Feb 07, 2018 8:58 am
by Trafitto
Thanks everyone, i was wondaring that if i wouldnt use the "android way" to handle multi language my app wouldnt be recognized properly multi language by the play store :)

Re: How to set up multiple languages ​​on Android

Posted: Fri Feb 16, 2018 2:33 pm
by Ulydev
Trafitto wrote: Wed Feb 07, 2018 8:58 am Thanks everyone, i was wondaring that if i wouldnt use the "android way" to handle multi language my app wouldnt be recognized properly multi language by the play store :)
I believe using ffi or digging into the Java code you could implement a function that returns the phone locale and translate based on that.
Either way there's no such built-in function as far as I know, I might be wrong though.