Adding strings at runtime

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding strings at runtime

Paul Johnson
Hi,

The current app I'm developing requires the use of a translation service
for phrases that are user defined and therefore unable to be placed into
the translation files.

I've found this link on stackoverflow which says it can sort of be done

http://stackoverflow.com/questions/6075158/can-strings-resource-files-be-added-at-runtime

but makes reference to genstrings. With monotouch, is genstrings
available for use once the app has been deployed and if it is, would I
need to use something like System.Environment to run the utility?

I'm not sure if it would be a simpler way to have a secondary
localization file (plain text file generated in app) and read from that
on runtime.

Any advice on this would be appreciated.

Thanks

Paul
--
"Space," it says, "is big. Really big. You just won't believe how
vastly, hugely, mindbogglingly big it is. I mean, you may think it's a
long way down the road to the chemist's, but that's just peanuts to
space, listen..."
Hitch Hikers Guide to the Galaxy, a truly remarkable book!

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: Adding strings at runtime

Nic Wise
I've been playing with Vernacular on the weekend (which worked quite
well for what I wanted)

Maybe you could either change the default iOS one to look somewhere
else (it uses the built in iOS <languagecode>.lproj/strings technique,
which is part of the bundle and hence read only), or write a new
catalog, and have it load from somewhere where you download it from?

In the end, you are still calling Catalog.GetString("somekey") all
over the place... (ie, "go and work out the language I'm using, and
find the transaction of "somekey")

Vernacular just helps you get all the strings _out_, and pluralize /
genderize them.

BTW, lets assume I (as a user) add "fuzzwubble" to your app.

Someone else uses it in German, and it needs to be "derfuzzenwubbleen".

a) how does this new word get to you to be translated?
b) how do you get the translation back? Are you doing it and putting
it on a web server somewhere?
c) what do you do if there is no translation yet (I assume display
english? Use google translate?)
d) thought about crazy long words (esp German)? Right to left? etc?







On 3 June 2013 12:56, Paul Johnson <[hidden email]> wrote:

> Hi,
>
> The current app I'm developing requires the use of a translation service for
> phrases that are user defined and therefore unable to be placed into the
> translation files.
>
> I've found this link on stackoverflow which says it can sort of be done
>
> http://stackoverflow.com/questions/6075158/can-strings-resource-files-be-added-at-runtime
>
> but makes reference to genstrings. With monotouch, is genstrings available
> for use once the app has been deployed and if it is, would I need to use
> something like System.Environment to run the utility?
>
> I'm not sure if it would be a simpler way to have a secondary localization
> file (plain text file generated in app) and read from that on runtime.
>
> Any advice on this would be appreciated.
>
> Thanks
>
> Paul
> --
> "Space," it says, "is big. Really big. You just won't believe how vastly,
> hugely, mindbogglingly big it is. I mean, you may think it's a long way down
> the road to the chemist's, but that's just peanuts to space, listen..."
> Hitch Hikers Guide to the Galaxy, a truly remarkable book!
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch