https://github.com/3sidedcube/android-lightninglanguage
https://github.com/3sidedcube/android-lightninglanguage
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/3sidedcube/android-lightninglanguage
- Owner: 3sidedcube
- License: apache-2.0
- Created: 2014-10-10T13:38:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-09-16T13:39:32.000Z (over 3 years ago)
- Last Synced: 2025-01-30T01:22:44.394Z (over 1 year ago)
- Language: Java
- Size: 1.29 MB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
#Storm Library - Module Language
Storm is a collection of libraries that helps make mobile and desktop applications easy to create using a high quality WYSIACATWYG editor.
This module's purpose is to help localise an app using key/value pairing. It works by detecting the language and locale of the device and loading an appropriate language, if one is available.
#Usage
##Gradle
Simply include the following for your gradle dependencies `com.3sidedcube.storm:language:0.1a`.
**Note** The versioning of the library will always be as follows:
`Major version.Minor version.Bug fix`
It is safe to use `+` in part of of the `Bug fix` version, but do not trust it 100%. Always use a *specific* version to prevent regression errors.
##Code
Include the following into your main application singleton
```java
LanguageSettings.Builder languageSettings = new LanguageSettings.Builder(this).build();
```
The default language that gets loaded by the module will be located in assets `assets://languages/xxx_xx.json` You will need to override this to provide your own default language path by using the `defaultLanguage()` method in `LanguageSettings$Builder`.
Example:
```java
languageSettings = new LanguageSettings.Builder(this)
.registerUriResolver("cache", ContentSettings.getInstance().getDefaultResolver()) // You can include this line if you are depending on ContentSettings
.defaultLanguage(Uri.parse("cache://languages/" + LanguageManager.getInstance().getLocale(this) + ".json"))
.build();
```
#Documentation
See the [Javadoc](http://3sidedcube.github.io/Android-LightningLanguage/) for full in-depth code-level documentation
#Contributors
[Callum Taylor (9A8BAD)](http://keybase.io/scruffyfox), [Tim Mathews (5C4869)](https://keybase.io/timxyz), [Matt Allen (DB74F5)](https://keybase.io/mallen), [Alan Le Fournis (067EA0)](https://keybase.io/alan3sc)
#License
See LICENSE.md