[mono-android] Resource files and localization
Jonathan Pryor
jonp at xamarin.com
Thu Feb 16 19:31:29 UTC 2012
On Feb 16, 2012, at 1:42 PM, Jonathan Chapman wrote:
> I have a library that is used across multiple types of projects (CF, ASP.NET, WPF, and now Android).
...
> I did find a post from July where someone was asking for this in MonoTouch and at that time it was said that there were bigger issues.
Unfortunately, decent support for localization hasn't made it onto our plates. (Something about fixing grefs, adding 3rd party .jar support, and lots of other things...)
I can say that there's ~no chance of there being a way to automagically use .NET resources, embedded in .NET resource assemblies, at runtime, because Android and iOS will frequently need the resources before any managed code has executed (e.g. splash screens).
If you want/need to use .NET resources, stored in assemblies and loaded at runtime, you'll need to eschew iOS/Android string resources and set object properties at runtime.
If you can be more flexible, you could write an XSLT/etc. to translate your .resx files into something suitable for use by Android and iOS. (Android, certainly; I'm less certain about iOS.)
Any future tooling that we provide will be likely be the same, conceptually: you fill in a "higher-level" file format which we then convert into Android .xml/.NET .resx/iOS whatevers (or .resx is the "native" format, I have no idea and haven't thought about it).
- Jon
More information about the Monodroid
mailing list