[MonoTouch] Multi-lingual
Danny Pronk
dpronk at probe-asp.eu
Fri Oct 7 06:20:18 EDT 2011
Hi Mittchel/Hoi Mittchel(dutch guy here too),
I was facing exactly the same problem in a project.
After investigation it turned out that you can't create/write new values in
those language resource files.
So I have chosen the following path :
1. Created a language resource table with sqlite
2. Build a function ReadResourceLanguageField(string UIResourceName) that
returns the value for a specific field
3. Inside this function I use NSLocale.PreferredLanguages[0] to determin the
current language and if it doesn't exist i revert back to a default language
4. Everywhere where I set/use values on screen I use the function
ReadResourceLanguageField("control.propertyname") so if you need to set the
local version of a label called lblHeader you would use "lblHeader.Text"
this way it is very clear where you set/fetch what value.
5. Last but not least i have build a checksum calculation on a given
language on changing language i check the checksum with a webservice which
returns OK (no changes) or replies with a new set of data for that specific
language which i then replace inside the database, or if it is a new
language it will create the records in the database. If the language is not
available it will return unkown and then i revert back to my default
language
Hopefully this helps you
Regards,
Danny Pronk
Van: Mittchel Van Vliet <mittchel at gmail.com>
Datum: Fri, 7 Oct 2011 11:54:53 +0200
Aan: <monotouch at lists.ximian.com>
Onderwerp: [MonoTouch] Multi-lingual
Hello everybody,
For an application that I'm going to develop I have to keep two different
languages in mind. These two might turn into more further in the future.
I've created an settings view where it's possible to select the Language
which gets saved in the local database.
But how do I arrange that if someone selects Dutch and saves it that
everything (UI/Text) turns into that language?
Regards,
Mittchel
_______________________________________________ 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/20111007/053e8f56/attachment.html
More information about the MonoTouch
mailing list