Search code examples
xamarin.formsglobalizationcultureinfoiso-639

Best way to allow users to add text in another language


I have a Xamarin Forms app where users enter the pieces of information they want to gather on a form. The user provides a caption for each piece of information. I want to allow the user to enter a caption for each piece of information in multiple languages. I was wondering if there was a best practice for doing this?

My thought was to load all the ISO-639-1 codes into a list in the app and let the user select from the list of ISO-639-1 languages. Then they could enter the caption for each piece of information in that language. Any other thoughts?

FYI - I want to use the ISO 639-1 codes as the key for the language in the app as that is what the CultureInfo.CurrentUICulture.TwoLetterISOLanguageName line of code returns in Xamarin Forms.


Solution

  • So I ended up loading a list of languages based on the ISO_639_1_Code into an object in my application. This is all hard coded fyi. Then I have a combobox where the user selects the language they would like to add translated captions for. When they enter the new languages, I save them in the app with the language code set as the ISO_639_1_Code. This is working fine for me.