• Stars
    star
    98
  • Rank 345,810 (Top 7 %)
  • Language
    C#
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multilingual Plugin for Xamarin and Windows

Multilingual Plugin (DEPRECATED)

Simple cross platform plugin for handling language localization.

IMPORTANT NOTE:

THIS PLUGIN IS DECPRECATED - NOT UNDER DEVELOPMENT AND NOT SUPPORTED

This plugin is no longer needed. More information here:

https://xamgirl.com/handle-multilingual-in-xamarin-forms-without-any-plugin/

Features

  • Get and set current culture
  • Get device culture
  • Get culture list
  • Get specific culture by name

Platform Support

Platform Version
Xamarin.iOS iOS 7+
Xamarin.Android API 10+
Windows 10 UWP 10+
Xamarin.Mac All
watchOS All
tvOS All

Setup

Getting Started

  1. Add your Resx files

Add one resx file per each language you want to support. "It must follow a specific naming convention: use the same filename as the base resources file (eg.ย AppResources) followed by a period (.) and then the language code".

  1. Set the culture of your resource class file when initializing your application.

For example:

  AppResources.Culture = CrossMultilingual.Current.DeviceCultureInfo;

If you are using Xamarin Forms it would be in your App.cs

Xamarin Forms Specifics

When installing the plugin it will create a TranslateExtension.txt file in folder Helpers, rename the extension for this file to TranslateExtension.cs.

In TranslateExtension.cs file in the constant ResourceId by default it will assume your resource file is added in the root of the project and the resx file is named as AppResources. If you added it to a folder or named the resx file differently you can change it there.

XAML sample usage:

iOS Considerations

In the Info.plist file add the keys Localizations & Localization native development region to change the user interface OS elements. It will take the device language.

API Usage

Call CrossMultilingual.Current from any project or PCL to gain access to APIs.

CurrentCultureInfo

Gets and set the current culture. By default will be set to the device culture.

Usage sample:

  CrossMultilingual.Current.CurrentCultureInfo = new CultureInfo("en");

Note: After changing the current culture is important to update your resx class culture. As follows:

AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo;

DeviceCultureInfo

Gets the device culture

Usage sample:

  CrossMultilingual.Current.DeviceCultureInfo;

CultureInfoList

Gets all cultures supported in .NET Framework (neutral & specific cultures)

Usage sample:

  CrossMultilingual.Current.CultureInfoList;

NeutralCultureInfoList

Gets all cultures associated with a language (not specific to a country/region).

Usage sample:

  CrossMultilingual.Current.NeutralCultureInfoList;

GetCultureInfo

Gets a specific culture by language code.

Usage sample:

  CrossMultilingual.Current.GetCultureInfo("es");

In case you want to know more about localization:

https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/

Contributors

More Repositories

1

FirebasePushNotificationPlugin

Firebase Push Notification Plugin for Xamarin iOS and Android
C#
393
star
2

xUber

Uber Clone using Xamarin Forms
C#
229
star
3

PushNotificationPlugin

Push Notification Plugin for Xamarin iOS and Android
C#
215
star
4

FacebookClientPlugin

Facebook Client Plugin for Xamarin iOS and Android
C#
106
star
5

CustomNavigationBarSample

Navigation Bar Customization in Xamarin Forms
C#
105
star
6

GoogleClientPlugin

Google Client Plugin for Xamarin iOS and Android
C#
89
star
7

ToolbarItemBadgeSample

Sample shows how to add a badge to ToolBarItems in Xamarin Forms for iOS and Android
C#
72
star
8

AzurePushNotificationPlugin

Azure Push Notification Plugin for Xamarin iOS and Android
C#
67
star
9

FileUploaderPlugin

Simple cross platform plugin to upload files.
C#
66
star
10

PaymentUISample

C#
65
star
11

GeofencePlugin

Geofence Plugin for Xamarin iOS and Android
C#
48
star
12

SocialMediaAuthenticationSample

Social Media Authentication Sample in Xamarin Forms
C#
47
star
13

BluetoothPrintSample

Sample that shows how to do bluetooth printing in Xamarin Forms using Shiny
C#
46
star
14

RefitXamarinFormsSample

C#
32
star
15

TooltipSample

Xamarin Forms Showing Tooltips Sample
C#
29
star
16

MultipleMediaPickerSample

Sample that shows how to pick multiple images/videos in Xamarin Forms
C#
28
star
17

OverlaySample

Sample that shows how to add native overlays in Xamarin Forms
C#
27
star
18

KeyboardAdjustmentSample

C#
26
star
19

DragViewSample

C#
25
star
20

SegmentedControlSample

C#
25
star
21

ValidationXFSample

C#
25
star
22

PayCardsPlugin

Plugin to scan credit card information using Pay.Cards library
C#
24
star
23

Xamarin.Forms.UI

C#
23
star
24

PickerWithIcon

C#
22
star
25

ExtendedSegmentedTabControl

C#
20
star
26

PrismV7Sample

C#
20
star
27

ClearableDatePickerSample

Clearable DatePicker Sample in Xamarin Forms
C#
19
star
28

UIPermissionsSample

C#
19
star
29

MultilingualXFSample

C#
18
star
30

Forms-TransparentNavigationBar

C#
18
star
31

PlugAndPlayAnimationsSample

C#
17
star
32

MasteringMultilingualSample

C#
16
star
33

StepBar

C#
16
star
34

ShowHidePasswordTrigger

C#
16
star
35

ExtendedTabbedPageSample

C#
14
star
36

MultipleDeviceResolutionSample

C#
14
star
37

WhiteLabelingXFSample

C#
14
star
38

StartupTaskSequenceSample

C#
13
star
39

ConnectionChangesForms

Handling connection changes in Xamarin Forms
C#
13
star
40

AppLinksSample

App Links Xamarin Forms Sample
C#
13
star
41

DeviceSensorsPlugin

Device Sensors Notification Plugin for Xamarin, Tizen and Windows
C#
12
star
42

CustomGallerySample

Sample that shows how to get device media and show it in Xamarin Forms
C#
11
star
43

DynamicDataXFSample

C#
11
star
44

WowzaClientPlugin

Wowza Client Plugin for Xamarin iOS and Android
C#
11
star
45

BraintreeXFSample

Braintree client side integration Xamarin Forms sample
C#
11
star
46

HashtagDetectorSample

Xamarin Forms Hashtag detector sample
C#
10
star
47

ShadowNavBarSample

C#
10
star
48

ShinyPrismSample

C#
10
star
49

ReactiveToDoSample

C#
10
star
50

TwoCardsAnimationControl

C#
10
star
51

SharedTransition.XF.Sample

C#
10
star
52

SignInWithAppleSample

Sample that shows how to support sign in with apple in a Xamarin Forms project
C#
10
star
53

UsefulConvertersSample

Xamarin Forms useful converters list.
C#
10
star
54

VisualStateManagerSample

C#
9
star
55

SharedSvgSample

Share SVG icons across platforms sample
C#
9
star
56

ScratchViewForms

C#
9
star
57

SkeletonCollectionLoadingXFSample

C#
9
star
58

LinkedInClientPlugin

LinkedIn Client Plugin for Xamarin iOS and Android
C#
8
star
59

WePayFormsSample

WePay Payment Gateway integration Xamarin Forms Sample
C#
8
star
60

EntryValidationSample

C#
8
star
61

RelativeTimeSample

Relative Time in Xamarin Forms
C#
8
star
62

ScrollRevealXFSample

C#
8
star
63

FloatingDecimalTextSample

C#
7
star
64

ControlTemplateSample

Sample that shows how to use Control Template in a ContentPage to switch view content
C#
7
star
65

DragAndDropXFSample

C#
7
star
66

AppShortcutsFormsSample

C#
6
star
67

ExtendedEditorSample

C#
6
star
68

ExpandParagraphControl

C#
6
star
69

HideShowXFSample

Sample about best way to hide/show views in Xamarin Forms
C#
6
star
70

ContactListSample

Sample that shows how to retrieve photo contacts in Xamarin Forms
C#
6
star
71

CachingDataXFSample

C#
5
star
72

DialogPrismSample

C#
5
star
73

MockingAppXamarinForms

MockingAppSample
C#
5
star
74

KeyboardOptionsSample

Xamarin Forms Sample that show options on top of keyboard
C#
5
star
75

RatingSliderSample

C#
4
star
76

ParticlesSample

Particle System Effect in Xamarin Forms
C#
4
star
77

DistanceBasedLocationUpdatesSample

Sample to get background distance-based location updates on iOS
C#
4
star
78

Xamarin.Wowza

Xamarin Wowza Bindings for Xamarin.Android and Xamarin.iOS
Objective-C
4
star
79

PrismRegionsXFSample

C#
4
star
80

BackgroundTimerSample

Sample to get battery efficient background time-based location updates on iOS
C#
4
star
81

LaunchGoogleMapsOnXamarinForms

A sample of how to open Google Maps on Xamarin Forms
C#
4
star
82

QuickTourXFSample

C#
3
star
83

MultiBindingConverterXFSample

C#
3
star
84

StateMachineVideoPlayerXFSample

C#
3
star
85

XamlTipsAndTricks

C#
2
star
86

XAMLMarkupExtensionSample

C#
2
star
87

PrismVisualStudioSnippets

2
star
88

ClearableTimePickerSample

C#
2
star
89

WebminarCustomRenderers

C#
2
star
90

RowMultiSelectionDynamicDataXFSample

C#
2
star
91

EnvironmentAppSample

C#
2
star
92

GuardXFSample

C#
1
star
93

CustomRendererVsEffectsSample

C#
1
star
94

ContactSharingXF

Contact Sharing Xamarin Forms Sample
C#
1
star
95

MultiBindingSamplee

C#
1
star
96

Plugin.Maui.Facebook

C#
1
star
97

ARKitSample

C#
1
star
98

TypeConverterSample

C#
1
star
99

MLNETSample

C#
1
star
100

iOS11FormsPrismSample

C#
1
star