MvvmCross localized Android activity label

What's the best way to localize an Android activity label using MvvmCross and the JsonLocalisation plugin? I tried changing it in the OnViewModelSet() method but I think that's too late in the activity lifecycle.

I'm beginning to think I may have to access the MvxLanguageBinder directly in my MvxActivity in the OnCreate() method.

Thoughts?

As always thanks again in advance!
Ryan

Posts

  • StuartLodgeStuartLodge USBeta ✭✭✭

    This "works on my machine"....

            Title = "Hello World";
    

    Just tried it in all sorts of places... seems to work....

    Also, note that OnViewModelSet is indirectly called during OnCreate so choosing between the two methods probably won't help that much...

  • rjygrahamrjygraham USBeta ✭✭

    Doh!

    I was using:

    base.Window.Title = ((BaseViewModel)base.ViewModel).TextSource.GetText("Title");

    Changing that to the line below works:

    base.Title = ((BaseViewModel)base.ViewModel).TextSource.GetText("Title");

    Thanks!

    Ryan

Sign In or Register to comment.