0

I have a Xamarin Forms app that is using Localization and it translates the text using the .resx files and it works fine. My problem is that I want the user data to be localized just like the static data of the app.

For example, the user name is actually stored in English

Username: James

when the user changes the default language to Spanish it looks like

Nombre de usuario: James

I want James to be translated to Spanish as well so that my app will be truly localized. How can I achieve this?

Siddhant maurya
  • 261
  • 1
  • 2
  • 12
  • You can use a .NET API for this. Check http://code.google.com/p/google-language-api-for-dotnet/ for a specific one. Using Google Translate in C# has a list of available options.Check https://stackoverflow.com/questions/2246017/using-google-translate-in-c-sharp – Lucas Zhang Mar 17 '21 at 08:06
  • Be aware that in general, language translation is a difficult task. In particular, it isn't always clear that you *should* translate what a user enters. If the user enters their name as `James`, it should stay `James`. It wouldn't make sense to alter the user's name. Often, its best to limit translation of user input to a list of phrases they can pick. Those phrases then would be translated by your resx, via an enum that associates an index with the chosen phrase. – ToolmakerSteve Mar 18 '21 at 00:08

0 Answers0