百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MultilingualPlugin

> 数据库
开源

适用于 Xamarin 和 Windows 的多语言插件

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

适用于 Xamarin 和 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

  • Available on NuGet: http://www.nuget.org/packages/Plugin.Multilingual
  • Install into your PCL project and Client projects.

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:

csharp
  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:

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

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

csharp
AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo;

DeviceCultureInfo

Gets the device culture

Usage sample:

csharp
  CrossMultilingual.Current.DeviceCultureInfo;

CultureInfoList

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

Usage sample:

csharp
  CrossMultilingual.Current.CultureInfoList;

NeutralCultureInfoList

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

Usage sample:

csharp
  CrossMultilingual.Current.NeutralCultureInfoList;

GetCultureInfo

Gets a specific culture by language code.

Usage sample:

csharp
  CrossMultilingual.Current.GetCultureInfo("es");

In case you want to know more about localization:

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

Contributors

  • Charlin Agramonte
  • Rendy Del Rosario

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#culturedevice-culturelanguagenuget

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库