Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How could I retrieve localization texts to modify elements name ?

$
0
0

Hello everyone :)

I would like to change a Forms button label when I click on it.

For example :

xaml :

<Button x:Name="ChangeMesureType" Clicked="ChangeMesureTypeClick" Text="{i18n:Translate Text=TypeMesure}"/>

...

CS :

void ChangeMesureTypeClick(object sender, EventArgs e)
{
var textbuttontext = ((Button)sender).Text;

        if (buttonText == 'metric')
            ((Button)sender).Text = "imperial";
        else
            ((Button)sender).Text = "metric";

....

But I would like to test and set the button text according to the langage setting.

I am using AppResources files and defined TypeMesure field with several langages.

Could you help me on this ?

Alain


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>