Refresh Localization on culture change

RichardLawidjajaRichardLawidjaja USMember
edited August 9 in Xamarin.Forms

Hi Guys , i am kinda stack in a problem

so right now my company wants to share the UI in a PCL project. We managed to do that. but right now i would like to ask your expertise
on how can i refresh the Translation on a button click

at this moment the resx files also going to be centralized and its located in PCL project any Idea?

Answers

  • N_BauaN_Baua INMember ✭✭✭✭✭

    If you are new to Xamarin Forms, localisation works really well.
    Read the following post.

    If you are aware of the above concepts, then calling the code (on Button Cllick or what ever) as under should work with no issues.

            public void SetLocale (CultureInfo ci)
            {
                Thread.CurrentThread.CurrentCulture = ci;
                Thread.CurrentThread.CurrentUICulture = ci;
            }
    

    Hope it helps.
    Regards,
    N Baua

Sign In or Register to comment.