All Projects → YarikSOffice → Lingver

YarikSOffice / Lingver

Licence: mit
Manage your application locale and language.

Programming Languages

kotlin
9241 projects
language
365 projects

Projects that are alternatives of or similar to Lingver

Languagetest
Changing the language on Android
Stars: ✭ 223 (-25.67%)
Mutual labels:  translation, localization, android-development
rosetta
A blazing fast internationalization (i18n) library for Crystal with compile-time key lookup.
Stars: ✭ 23 (-92.33%)
Mutual labels:  translation, localization
Js Lingui
🌍📖 A readable, automated, and optimized (5 kb) internationalization for JavaScript
Stars: ✭ 3,249 (+983%)
Mutual labels:  translation, localization
flutter-internationalization
Flutter Internationalization by Using JSON Files
Stars: ✭ 18 (-94%)
Mutual labels:  translation, localization
inlang
Open Source Localization Solution for Software.
Stars: ✭ 160 (-46.67%)
Mutual labels:  translation, localization
translation
👅 Translations (symfony/translation) to Nette Framework (@nette)
Stars: ✭ 55 (-81.67%)
Mutual labels:  translation, localization
i18n-tag-schema
Generates a json schema for all i18n tagged template literals in your project
Stars: ✭ 15 (-95%)
Mutual labels:  translation, localization
Localisation
Repository for translation and discussion for OpenRCT2.
Stars: ✭ 49 (-83.67%)
Mutual labels:  translation, localization
blazor-ui-messages
Localization messages for Telerik UI for Blazor components: https://www.telerik.com/blazor-ui
Stars: ✭ 24 (-92%)
Mutual labels:  translation, localization
labels
Bolt Labels extension - Translatable labels for Bolt
Stars: ✭ 18 (-94%)
Mutual labels:  translation, localization
Mojito
An automation platform that enables continuous localization.
Stars: ✭ 256 (-14.67%)
Mutual labels:  translation, localization
i18n
internationalize projects to Arabic
Stars: ✭ 67 (-77.67%)
Mutual labels:  translation, localization
i18n.cr
Internationalization API ( i18n ) for Crystal!
Stars: ✭ 36 (-88%)
Mutual labels:  translation, localization
Translatio
Super lightweight library that helps you to localize strings, even directly in storyboards!
Stars: ✭ 19 (-93.67%)
Mutual labels:  translation, localization
lost-in-translation
Uncover missing translations and localization strings in Laravel applications.
Stars: ✭ 32 (-89.33%)
Mutual labels:  translation, localization
plate
Internationalization library for Python
Stars: ✭ 31 (-89.67%)
Mutual labels:  translation, localization
Tower
i18n & L10n library for Clojure/Script
Stars: ✭ 264 (-12%)
Mutual labels:  translation, localization
fluent-vue
Internationalization plugin for Vue.js
Stars: ✭ 137 (-54.33%)
Mutual labels:  translation, localization
mobility-actiontext
Translate Rails Action Text rich text with Mobility.
Stars: ✭ 27 (-91%)
Mutual labels:  translation, localization
loco-php-sdk
Loco SDK for PHP including REST API client
Stars: ✭ 12 (-96%)
Mutual labels:  translation, localization

Lingver

Lingver is a library to manage your application locale and language.

Once you set a desired locale, Lingver will enforce your application to provide correctly localized data via Resources class.

The library contains an implementation of the approach described in the following blogpost.

Setup

The setup is pretty simple:

  1. Initialize the library in Application.onCreate:
Lingver.init(context, defaultLanguage)

See the sample app for more customization options.

  1. Change a locale, for instance, from your setting screen:
 Lingver.getInstance().setLocale(context, language)

Note that you need to update all already fetched locale-based data manually. Lingver is not responsible for that.

Follow the system locale

You can configure Lingver to follow the system locale whenever it changes:

 Lingver.getInstance().setFollowSystemLocale(context)

Note that any call to setLocale() stops following the system locale and resets isFollowingSystemLocale() setting.

WebView

Starting from Android N, there is a weird side effect while using a WebView in your application. For unknown reasons, the very first creation of it (either programmatically or via inflation) resets an application locale to the system default. Obviously, this is not what we expect to happen. Moreover, it's not going to be fixed anytime in the future according to the issuetracker. That's why we should somehow deal with it on our own.

There are plenty of ways how we can fix that, but the idea stays always the same. You have to set back the desired locale after the first usage of a WebView. For instance, you can even programmatically create a fake WebView and immediately set a locale back which prevents this side effect from happening in the future. See an example of implementation in the sample app.

App Bundles

While using an app bundle, a user’s device only downloads string resources that match the one or more languages currently selected in the device’s settings. Refer to this page if you want to change this behavior and have access to additional language resources.

Download

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation "com.github.YarikSOffice:lingver:1.3.0"
}

License

The MIT License (MIT)

Copyright 2019 Yaroslav Berezanskyi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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].