Hi..
I'm porting a Windows Mobile application to iOS and it's time for
localization. I read about NSBundle.MainBundle.LocalizedStrings and the tool
for extract it from the application, but I didn't like at all
As I have this already localized on Windows Mobile application, I tried to
copy my Library.Designer.cs generated on Visual Studio 2008 and the resx
files Library.resx, Library.es.resx (generic spanish) and Library.es-CH.resx
(chilean spanish), changed resx'es to Embed Resource, compiled and run
without errors.
But, no translations was made changing iOs settings, and just the original
text from Library.resx is shown. Debugging I found that Library.Designer.cs
has resourceCulture = null, so at constructor I put a
manual-not-necessary-on-windows resourceCulture =
System.Globalization.CultureInfo.CurrentCulture, and checked on debugging
that resourceCulture now has es-CH, but still no translated text appeared.
A sample of property generated on Visual Studio that runs OK there but on
MonoTouch returned default text but not the translated:
/// <summary>
/// Looks up a localized string similar to Convidados.
/// </summary>
internal static string CONVIDADOS {
get {
return ResourceManager.GetString("CONVIDADOS",
resourceCulture);
}
}
So, on code I call something like myButton.Text = Library.CONVIDADOS and it
has to return localized text from resx.
No idea what to do or how to use it, but it can help against the lack of
localization on iOS that support just spanish or english or portuguese but
not es and es-CH and es-AR and pt-BR and pt all as differente things. There
is a way to use resx correctly? Something missing here?
I just don't want to put a #if PocketPC and #if Android and #if iOS on
everywhere for each text I think that could be possible to do it on a .net
way.
Also missing about the lack of UI resources like on windows. And still a lot
of people condemn windows development where without a line of code I have
ASP.NET applications, desktop applications and windows mobile applications
localized, not just text translation but with custom control properties
(width, Visilibity and others) based on language and country
I have fear now to discover how this runs on Android.
Karl
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch