Issue
I need to access to the string.xml on the Resources folder to made my multilingual app.
I'm trying to find a way to do it. It should be simple but I didn't find and answer. This is my string.xml
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<string name="Text">Text</string>
</resources>
I need to set the property text to my button. I try this but it doesn't work.
<Button x:Name="btn" Text="@string/Text"/>
Also I need to set the property by programmability. Somo thing like:
btn.Text=Resources.GetString(Resource.String.Text);
How could I do it?
Thank you.
Solution
There is no need to use resource file like this in xamarin.forms. Check this article this will help you:
- https://xamgirl.com/handle-multilingual-in-xamarin-forms-without-any-plugin/
- https://www.c-sharpcorner.com/article/xamarin-forms-multiligual/
What you have done, we normally follow in Xamarin.Android project not in Xamarin.Forms.
Answered By - Divyesh_08
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.