question

GordonS-9701 avatar image
0 Votes"
GordonS-9701 asked ·

Xamarin Forms Multilingual support and managing the content

I am using Xamarin Forms 5 with Visual Studio 2019 to create an App. The app needs to support multiple languages, so I have been looking at the use of Resource files. The concept looks fine, in terms of the programming side of things, but what about the task of creating the translations into other languages?

For our website, we are able to export the dictionary of content to an XML file, which a translation company can work with and return. We can then import that back into the website.

The app won't have the same amount of textual content, but I don't see how I can use resx files in a similar way. So, how do others manage the task of creating the content in "other" language files?

Some examples I have seen, such as this one - https://xamgirl.com/handle-multilingual-in-xamarin-forms-without-any-plugin/ - show the resources file to be plain XML, but my AppResources file produces a .resx and a .Designer.cs file, neither of which I could confidently send to a translation service company (I don't think?!)

At this point in time, I don't expect to need localised images, etc - but I appreciate that would change my requirements significantly!

dotnet-xamarinforms
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Based on my research, Xamarin.Forms do not support translations services, You can make a feature request for this need in github:https://github.com/xamarin/Xamarin.Forms/issues

0 Votes 0 ·

1 Answer

StanLogan avatar image
0 Votes"
StanLogan answered ·

Unless something has changed with XF 5, the .resx files are actually XML files. To see this, select a .resx file in your Solution Explorer, right-click, and select Open With... then choose XML (Text) Editor.

The .resx files normally open with the default editor for the file type, which gives you the standard key/value editor. But if you search for some localized text, and it finds it in the .resx file, when you double click the search result, the file will open as text and show the XML.

This is a large area that I was once familiar with - but have since forgotten a lot. The way we do it, we currently just maintain the translations using the ResXManager extension, which allows us to provide translations for multiple languages in the same UI window.

As far as sending files out to be translated - if you just send the .resx as .xml instead, and the translators are able to maintain the file structure, you shouldn't have any problem bringing them back into your project.

Hope this helps.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your reply, it was very helpful. Also, ResXManager looks like it will be very useful!

0 Votes 0 ·