Can't get string values from strings.xml file

I'm trying to add translations to my android project. I've added two new folders (values-en-rGB and values-de-rDE) and each of these folders has a strings.xml file. But when I change the Locale and Configuration (pretty much what I have to do when I want to change a language in Android) it doesn't work. It either shows me the id of the string resource, throws an exception if I try to get a translation in my code or it shows the default if I have the default translations in there. I don't know what do to anymore so any help would by highly appreciated!

Answers

  • BillyLiuBillyLiu Member, Xamarin Team Xamurai

    @BernardoRodrigues

    What exception do you get?
    Please check the following link for localization in Xamarin.Android:
    https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/localization

  • BernardoRodriguesBernardoRodrigues Member ✭✭
    edited October 2018

    @BillyLiu I usually don't get an error because I use the strings in my axml files so it pretty much only shows id of string but if I do try to reference them I get a Android.Content.Res.Resources+NotFoundException. I also should note that in my default values folder my strings.xml file doesn't have the strings that exist in the strings.xml files in values-en-rGB and in values-de-rDE. If I do add default strings there the GetString method won't even try to get the translations.

Sign In or Register to comment.