Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fluidsonic/fluid-i18n
Kotlin multiplatform internationalization library (experimental)
https://github.com/fluidsonic/fluid-i18n
i18n internationalization kotlin kotlin-multiplatform localization
Last synced: about 1 month ago
JSON representation
Kotlin multiplatform internationalization library (experimental)
- Host: GitHub
- URL: https://github.com/fluidsonic/fluid-i18n
- Owner: fluidsonic
- License: apache-2.0
- Created: 2020-08-24T01:11:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-24T03:31:00.000Z (over 1 year ago)
- Last Synced: 2023-08-09T20:09:22.947Z (over 1 year ago)
- Topics: i18n, internationalization, kotlin, kotlin-multiplatform, localization
- Language: Kotlin
- Homepage:
- Size: 1.73 MB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fluid-i18n
============[![Maven Central](https://img.shields.io/maven-central/v/io.fluidsonic.i18n/fluid-i18n?label=Maven%20Central)](https://search.maven.org/artifact/io.fluidsonic.i18n/fluid-i18n)
[![Tests](https://github.com/fluidsonic/fluid-i18n/workflows/Tests/badge.svg)](https://github.com/fluidsonic/fluid-i18n/actions?workflow=Tests)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.8.22%20(Darwin,%20JVM,%20JS)-blue.svg)](https://github.com/JetBrains/kotlin/releases/v1.8.22)
[![#fluid-libraries Slack Channel](https://img.shields.io/badge/slack-%23fluid--libraries-543951.svg?label=Slack)](https://kotlinlang.slack.com/messages/C7UDFSVT2/)Kotlin multiplatform internationalization support backed by [Unicode CLDR](http://cldr.unicode.org/) data.
**Highly experimental. Feel free to contribute!**Installation
------------`build.gradle.kts`:
```kotlin
dependencies {
implementation("io.fluidsonic.i18n:fluid-i18n:0.13.0")
}
```Usage
-----### Country names
```kotlin
val usa = Country.byCode("US")
println(usa.name) // United States
println(usa.shortName) // US
println(usa.variantName) // nullval locale = Locale.forLanguage("de")
println(usa.name(locale)) // Vereinigte Staaten
println(usa.shortName(locale)) // USA
println(usa.variantName(locale)) // nullval ivoryCoast = Country.forCode("CI")
println(usa.name) // Côte d’Ivoire
println(usa.shortName) // null
println(usa.variantName) // Ivory Coast
```Building
--------Build generated Kotlin files for Unicode CLDR data:
```shell
./gradlew generateCode # macOS
gradlew generateCode # Windows
```License
-------Apache 2.0