This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Forms
DeanFaizal edited this page Mar 4, 2019
·
5 revisions
Localization is implemented using .resx resources based on the official Xamarin sample as LocalizationService
and BaseLocalizationService
.
To support additional languages, create a .resx file language using the CultureInfo TwoLetterISOLanguageName
. For example, AppResources.ar.resx
for Arabic. Supported CultureInfos can be queried using CultureInfo.GetCultures(types) on each device.
The localized strings are then populated as XML data:
<data
name="heavythunderstorm"
xml:space="preserve">
<value>Heavy thunderstorm</value>
<comment>weather condition</comment>
</data>
Localized strings can then be fetched using LocalizationService.Translate(resourceName)
RTL (Right-to-Left) language support is enabled using the Xamarin Forms Device.FlowDirection Property
public static Xamarin.Forms.FlowDirection FlowDirection { get; }
It can be set on the FlowDirection property of the ContentPage like so
FlowDirection="{x:Static Device.FlowDirection}"