All Projects → scfhao → SOLocalization

scfhao / SOLocalization

Licence: other
Configure multi-language environment in iOS application

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to SOLocalization

android-studio-plugin
Integrate your Android project with Crowdin
Stars: ✭ 52 (+300%)
Mutual labels:  localization
Domino-English-Translation
🌏 Let's translate Domino, a Japanese MIDI editor!
Stars: ✭ 29 (+123.08%)
Mutual labels:  localization
Lingo-Vapor
Vapor provider for Lingo - the Swift localization library
Stars: ✭ 45 (+246.15%)
Mutual labels:  localization
I18N
I18N Library for .NET, and Delphi
Stars: ✭ 48 (+269.23%)
Mutual labels:  localization
go-localize
i18n (Internationalization and localization) engine written in Go, used for translating locale strings.
Stars: ✭ 45 (+246.15%)
Mutual labels:  localization
GA SLAM
🚀 SLAM for autonomous planetary rovers with global localization
Stars: ✭ 40 (+207.69%)
Mutual labels:  localization
LocalizationService
Tools for localization Unity's UIText components
Stars: ✭ 22 (+69.23%)
Mutual labels:  localization
laravel-translate
Generate translation files for Laravel using Google Translate
Stars: ✭ 22 (+69.23%)
Mutual labels:  localization
odoo-th
Ready to use Odoo with OCA Thai localization modules
Stars: ✭ 29 (+123.08%)
Mutual labels:  localization
ReaperJPN-Phroneris
製品版REAPER日本語化パッチ(森)
Stars: ✭ 41 (+215.38%)
Mutual labels:  localization
contiki-uwb
Contiki OS, Glossy and Crystal port for the DecaWave EVB1000 and DWM1001 platforms featuring the DW1000 UWB transceiver
Stars: ✭ 22 (+69.23%)
Mutual labels:  localization
ros-vrep-slam
ROS and V-REP for Robot Mapping and Localization
Stars: ✭ 39 (+200%)
Mutual labels:  localization
awesome-translations
😎 Awesome lists about Internationalization & localization stuff. l10n, g11n, m17n, i18n. Translations! 🌎🌍
Stars: ✭ 54 (+315.38%)
Mutual labels:  localization
www.mozilla.org
Localization of www.mozilla.org
Stars: ✭ 62 (+376.92%)
Mutual labels:  localization
french
French language pack to localize the Flarum forum software plus its official and third-party extensions.
Stars: ✭ 17 (+30.77%)
Mutual labels:  localization
react-i18next-phraseapp
Library support to use react-i18next with the Phrase In-Context Editor - DEPRECATED
Stars: ✭ 14 (+7.69%)
Mutual labels:  localization
lingua
A PHP-7 language codes converter, from and to the most common formats (ISO or not)
Stars: ✭ 35 (+169.23%)
Mutual labels:  localization
HEAPUtil
Code for the RA-L (IROS) 2021 paper "A Hierarchical Dual Model of Environment- and Place-Specific Utility for Visual Place Recognition"
Stars: ✭ 46 (+253.85%)
Mutual labels:  localization
codac
Codac is a library for constraint programming over reals, trajectories and sets.
Stars: ✭ 31 (+138.46%)
Mutual labels:  localization
dart.cn
Dart docs localization, get started from the wiki page here: https://github.com/cfug/dart.cn/wiki
Stars: ✭ 64 (+392.31%)
Mutual labels:  localization

SOLocalization

Configure multi-language environment in iOS application.

在 iOS 应用中切换使用的语言。

Feature

  • 切换语言后不需要界面跳转。
  • 默认使用当前系统设置的语言。
  • 使用简单、扩展方便、速度很快。
  • UILabel、UITextField 增加对 AttributedText 的支持。
  • 第三方增加对 MJRefresh 的支持。

Usage

Export SOLocalization

Copy SOLocalization.{h, m} and UIKit Folder to your project.

把 SOLocalization 类文件及 UIKit 文件夹中的文件复制到你的项目中。

Create strings file

Create Strings file for your project, The default strings file is named infoPlist.strings.

创建本地化字符串文件,默认为 infoPlist.strings,设置好需要本地化的内容。

Configure

Configure support language and fallback language。

设置应用中支持的语言及默认语言(建议在AppDelegate中设置)。

[SOLocalization configSupportRegions:@[SOLocalizationEnglish, SOLocalizationSimplifiedChinese] fallbackRegion:SOLocalizationEnglish];

Set Localized String

Set property for supported UIKit element

为 UIKit 元素设置需要的属性,像下面这样简单:

UIBarButtonItem *change = [[UIBarButtonItem alloc]initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(changeLanguage:)];
change.sol_title = @"Setting";
self.navigationItem.rightBarButtonItem = change;

self.label.sol_text = @"label";
[self.button sol_setTitle:@"button" forState:UIControlStateNormal];

self.textField.sol_placeholder = @"textField placeholder";

self.navigationItem.sol_title = @"title";

or, direct use SOLocalizedStringFromTable get localized string

对于不支持的 UIKit 元素,也可以像下面的代码这样获取本地化字符:

self.title = SOLocalizedStringFromTable(@"title", @"infoPlist");

Setting application Language

切换应用中的语言,已增加对第三方 MJRefresh 的支持,切换语言后,MJRefresh 中的语言也会跟随 SOLocalization 的设置显示,理论上其他第三方也可支持。

// to use English
[SOLocalization sharedLocalization].region = SOLocalizationEnglish;

// to use 简体中文
[SOLocalization sharedLocalization].region = SOLocalizationSimplifiedChinese;

License

SOLocalization is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].