Localization in Xamarin Forms

Hi,

I am implementing localization in Xamarin Forms app. After login, i open a setting page and change the locale. It's a simple hierarchical navigation using Navigation.PushAsync(new LocalePage()) . After changing the locale i pop that LocalePage from stack i.e. Navigation.PopAsync()

In the current page, i have one label control which i have binded with AppResource i.e. Text="{i18n:Translate dashboard}"

But after changing the locale, it's doesn't reflect the changes with current locale.

Can someone let me know that am i doing any mistake here ?

Answers

  • SamiPoimalaSamiPoimala USMember ✭✭

    If you are simply popping the page, the resources will not be evaluated again. You are simply being displayed the previous page on your nav stack (still in the memory).

    You need to push a new page for new resource texts to be loaded.

  • DeveshMishraDeveshMishra USMember ✭✭

    @SamiPoimala said:
    If you are simply popping the page, the resources will not be evaluated again. You are simply being displayed the previous page on your nav stack (still in the memory).

    You need to push a new page for new resource texts to be loaded.

    So, you mean to say that i have to explicitly navigate to a new page after changing the locale. There is no other way to refresh the current page using binding.

Sign In or Register to comment.