[MonoTouch] Embed RESX for Localization

Karl Heinz Brehme Arredondo karl at e-magesolutions.com
Wed Aug 3 12:10:39 EDT 2011


Thanks a lot.

If later you need exactly code of what I copied from Visual Studio
2008/Windows Mobile/netcf 2 I can private.

And to resume: code created on VS 2008 for resx was compiled on
MonoTouch/MonoDevelop and it has get the default text of each string
resource, but when changing iOS config to another country and language it
still got default text. But at least got some text from VS 2008 netcf
classes.

I have about 1 month to to basic localizations and will try something in VS
model to implement something temporary. BTW, Lion and bugs are more
important now.

Thanks,

Karl

From:  Rodrigo Kumpera <kumpera at xamarin.com>
Date:  Wed, 3 Aug 2011 12:56:08 -0300
To:  Karl Heinz Brehme Arredondo <karl at e-magesolutions.com>
Cc:  "monotouch at lists.ximian.com" <monotouch at lists.ximian.com>
Subject:  Re: [MonoTouch] Embed RESX for Localization

Hi Karl,

Your email caused a very heated argument internally at Xamarin because, yes,
our localization story is not as nice as we want it to be.
Right now we are sorting out more urgent matters like crashers, bugs and
critical features such as Lion support.
Rest assured that your email caught our attention and we have the issue on
our radar.


On Wed, Aug 3, 2011 at 12:48 PM, Karl Heinz Brehme Arredondo
<karl at e-magesolutions.com> wrote:
> (Resending if no one saw)
> 
> 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 <http://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
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
> 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20110803/fff064d1/attachment.html 


More information about the MonoTouch mailing list