@mysps I don't think that Gideros's Application:getLocale is tied up to settings in xcode, but more checking the settings on your device. As in if you change the locale of your device, it should also change the locale that Application class returns
@mysps, For itunes connect to recognize multiple locales, you need to set the pList (which your screenshot above shows has been done). This will show based on the locale set on the system. In your application, you have to check what locale is present on the system and then swap/switch to it accordingly.
What do you mean by "doesn't work for me"
@chipster123, I think as long as you get the unicode characters right and the fonts contain the arabic characters, you are good to go. I think that you can set all the same based on ar_XX. There are slight variations in the language based on regions, just like there are even in English, Thongs in Australia are what the Americans call the Flip-Flops, and thongs are used differently there than to wear on your feet.
@Chipster123, while that resource from IBM is a good reference point, are you sure that it works for you on the iOS devices? For ZDay I had to get Chinese and English working, with Chinese, I can see zh_Hans_XX and zh_Hant_XX but I had to just use the zh_Hans or the zh_Hant (which is Hans for simplified and Hant for traditional, we went with simplified only)
@ozapps.. Yes, I've worked with localized projects in the past using xcode and change the device language but it doesnt seem to work. if thats what you mean
Is that all that I had to do? its the only thing holding me back from release although i could release it half @ss without localization but this specific app would be better to cater to other languages.
@mysps, there are two things 1. iTunes recognizing that the app supports multiple localizations 2. Your app working in multiple languages as per the locale of the device.
for #1, that is all you need to do
for #2, obviously, you need to translate all the strings, messages, etc does not happen automatically.
if this is not what you meant, I am lost on what exactly are you stuck at and suggesting.
for #1, for iTunes to recognize the app supports multiple locales, it's handled entirely in the XCode project tree via InfoPlist.strings files. Is that right?
And for #2, we handle switching strings that are displayed while the app is running entirely within Gideros. Is that right?
Then my follow-up questions are:
A. Can someone point me to the iOS information for setting up the InfoPlist.strings ? B. Is there something we need to do for Android (GooglePlay and/or Amazon) to make those app stores recognize localization supported?
Great! Thanks! But when i'm trying to change from, for example "fr_FR", to "en_EN" nothing happens. I have a file for "fr_FR". I thought that after changing locale to smth that i don't have it will use default text. But it doesn't. How to return to default?
@mysps I don't think that Gideros's Application:getLocale is tied up to settings in xcode, but more checking the settings on your device. As in if you change the locale of your device, it should also change the locale that Application class returns
@mysps, there are two things 1. iTunes recognizing that the app supports multiple localizations 2. Your app working in multiple languages as per the locale of the device.
for #1, that is all you need to do
for #2, obviously, you need to translate all the strings, messages, etc does not happen automatically.
if this is not what you meant, I am lost on what exactly are you stuck at and suggesting.
@OZApps In my screenshot I've tried to set it up in plist and the strings are translated with an Image. I'm not translating text. I have the images set like: image_en.png image_es.png etc
Im stuck as well, trying to understand because I did follow the github and it seemed pretty simple.
@mysps, Localization does not happen automatically like retina high resolution graphics. By naming an image it will not do anything automatically.
When you say GitHub, I am lost but I think you are referring to some Gideros Code that helps you do localization (I am not aware of this)
How I would manage this is
somewhere in the start of my program, I would get the locale of the device, this would help me determine what language and localizations are running on my phone, save this two letter code to a variable.
then on, I would either use multiple if..then statements or construct strings that would incorporate the locale code in it.
Just so that you are clear and understand this, your app can be an English only app on the app store but have the functionality to swap languages, because these are two different things and totally unrelated.
--[[
*************************************************************
* This script is developed by Arturs Sosins aka ar2rsawseen, <a href="http://appcodingeasy.com" rel="nofollow">http://appcodingeasy.com</a>
* Feel free to distribute and modify code, but keep reference to its creator
*
* Gideros Localize class provides localization support for gideros,
* by loading string constants from specific files based on user locale.
* This class also has function, that allows string formating printf style,
* and dynamic loading of language specific images (images with texts).
*
* For more information, examples and online documentation visit:
* <a href="http://appcodingeasy.com/Gideros-Mobile/Localization-in-Gideros" rel="nofollow">http://appcodingeasy.com/Gideros-Mobile/Localization-in-Gideros</a>
**************************************************************
]]--
module("Localize", package.seeall)--public properties
path ="locales"
filetype ="lua"--local propertieslocal locale = application:getLocale()local file
local data ={}--initialziationif filetype =="lua"then
file =loadfile(path.."/"..locale.."."..filetype)if file then
data =assert(file)()endelseif filetype =="json"then
file =io.open(path.."/"..locale.."."..filetype, "r")if file then
data = Json.Decode(file:read("*a"))endend--public method for overriding methodsfunction load(object, func, index)if object ~=niland object[func] ~=niland object.__LCfunc ==nilthen
object.__LCfunc = object[func]
object[func]=function(...)
arg[index]= data[arg[index]]or arg[index]return object.__LCfunc(unpack(arg))endendend--overriding native objects
load(string, "format", 1)
load(TextField, "new", 2)
load(Texture, "new", 1)
@mysps yes this is my implementation of localization and since it is pure Lua, it is completely platform independent and will work with any Gideros app
Thanks @ar2rsawseen -- based on my code I havent' left anything out correct? I didnt localize any strings because I don't have any. Should I add anything else to xcode? I saw plist strings file was empty but am I suppose to be adding anything there?
I've changed the local of the simulator to Spanish in this case above but it still shows the english file name.
so by default Localize loads the value which is returned by application:getLocale() but then later you can change the localization to any other language, by calling Localize.changeLocale(locale)
So first thing to check if you don't force the locale by calling Localize.changeLocale(locale) and second thing to check, what does the application:getLocale() returns
Ok... I guess I'll just give up momentarily because based on what I've tried, I can't get anything to work even inside of Gideros player. Does the image portion work independently of Textwrap? I've gutted most of it and I cannot get the image to change even in the Gideros Player
Does it matter that my page is using self and not local like the example?
I'll pay anyone to help me. I would like to finally launch before Christmas. Please send a pm because I'm honestly desperate to get my first Gideros app in the stores.
1) explain more on what you want to achieve Do you want the app to automatically take the locale of phone? or do you want to implement buttons to switch between different languages?
2) does the provided example with the Localize lib work on your PC?
The example works on my pc fine. When I try to add the simple translation for the alert it doesnt work. I've added the code for those and attached the plugin. Is there something else I'm missing?
I only want to take the default start_en.png image and translate it to the phones local of the user, I've tried for Spanish to change to this image: start_es.png.
@chipster123 yes I think we resolved the issue, do you also have the same problem? If yes, here is an excerpt of our conversation:
Because the lib is based on locale, on ios you should change the locale (Region (Settings > International > Region) ) and not the language (Settings -> International -> Language) and it should work as expected If you want it to work with language you could also do that with language by calling Localize.changeLocale(application:getLanguage()) but only in that case you need to rename your locale files, from lv_LV to simply lv because that is what is returned from application:getLanguage()
Hi, yes that was the issue and all works perfect. I knew it was something silly. @ar2rsawseen . I did notice when calling the language via Localize.changeLocale(application:getLanguage()). Some languages did require using for example jp_JP and not ja. I believe three languages were like that. So I've added those with no problem!
I'm submitting today
Can't wait for auto scaling because I had trouble with my scaling. After the update I'll update too lol
Comments
As in if you change the locale of your device, it should also change the locale that Application class returns
BTW, I'm using this as a reference for locales : http://pic.dhe.ibm.com/infocenter/forms/v3r5m1/index.jsp?topic=/com.ibm.form.designer.locales.doc/i_xfdl_r_formats_tr_TR.html
For itunes connect to recognize multiple locales, you need to set the pList (which your screenshot above shows has been done). This will show based on the locale set on the system. In your application, you have to check what locale is present on the system and then swap/switch to it accordingly.
What do you mean by "doesn't work for me"
@chipster123, I think as long as you get the unicode characters right and the fonts contain the arabic characters, you are good to go. I think that you can set all the same based on ar_XX. There are slight variations in the language based on regions, just like there are even in English, Thongs in Australia are what the Americans call the Flip-Flops, and thongs are used differently there than to wear on your feet.
Likes: chipster123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Likes: chipster123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Is that all that I had to do? its the only thing holding me back from release although i could release it half @ss without localization but this specific app would be better to cater to other languages.
1. iTunes recognizing that the app supports multiple localizations
2. Your app working in multiple languages as per the locale of the device.
for #1, that is all you need to do
for #2, obviously, you need to translate all the strings, messages, etc does not happen automatically.
if this is not what you meant, I am lost on what exactly are you stuck at and suggesting.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Do I have this correct:
for #1, for iTunes to recognize the app supports multiple locales, it's handled entirely in the XCode project tree via InfoPlist.strings files. Is that right?
And for #2, we handle switching strings that are displayed while the app is running entirely within Gideros. Is that right?
Then my follow-up questions are:
A. Can someone point me to the iOS information for setting up the InfoPlist.strings ?
B. Is there something we need to do for Android (GooglePlay and/or Amazon) to make those app stores recognize localization supported?
#1 -> Yes
#2 -> Yes
A -> Localization (See image)
B -> Keine ahnung, No idea...
Likes: chipster123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Likes: chipster123
Likes: unlying
But when i'm trying to change from, for example "fr_FR", to "en_EN" nothing happens.
I have a file for "fr_FR". I thought that after changing locale to smth that i don't have it will use default text. But it doesn't. How to return to default?
BUT...
already replaced string won't be replaced back, as in if you already displayed scene as fr_FR, then you should reload the scene after changing locale
Likes: unlying
In my screenshot I've tried to set it up in plist and the strings are translated with an Image. I'm not translating text. I have the images set like: image_en.png image_es.png etc
Im stuck as well, trying to understand because I did follow the github and it seemed pretty simple.
Localization does not happen automatically like retina high resolution graphics. By naming an image it will not do anything automatically.
When you say GitHub, I am lost but I think you are referring to some Gideros Code that helps you do localization (I am not aware of this)
How I would manage this is
somewhere in the start of my program, I would get the locale of the device, this would help me determine what language and localizations are running on my phone, save this two letter code to a variable.
then on, I would either use multiple if..then statements or construct strings that would incorporate the locale code in it.
Just so that you are clear and understand this, your app can be an English only app on the app store but have the functionality to swap languages, because these are two different things and totally unrelated.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
My localization.lua
Likes: chipster123
I've changed the local of the simulator to Spanish in this case above but it still shows the english file name.
but then later you can change the localization to any other language, by calling Localize.changeLocale(locale)
So first thing to check if you don't force the locale by calling Localize.changeLocale(locale) and second thing to check, what does the application:getLocale() returns
Does it matter that my page is using self and not local like the example?
I'll pay anyone to help me. I would like to finally launch before Christmas. Please send a pm because I'm honestly desperate to get my first Gideros app in the stores.
thank you
Do you want the app to automatically take the locale of phone?
or
do you want to implement buttons to switch between different languages?
2) does the provided example with the Localize lib work on your PC?
I only want to take the default start_en.png image and translate it to the phones local of the user, I've tried for Spanish to change to this image: start_es.png.
The images work fine in the example code.
thanks
If yes, here is an excerpt of our conversation: Hope that helps
I'm submitting today
Can't wait for auto scaling because I had trouble with my scaling. After the update I'll update too lol
Thanks again @ar2rsawseen
Or do I have to do something special with Gideros?