Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.
/ kokusaika Public archive

๐ŸŒ simple internationalization for kotlin

Notifications You must be signed in to change notification settings

mixtape-bot/kokusaika

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Kokusai-ka

ๅ›ฝ้š›ๅŒ– (Kokusai-ka "internationalization") is a simple kotlin internationalization library that makes use of kotlinx.serialization and Java's Locale class.

๐Ÿšง Installation

Groovy
repositories {
  maven { url "https://dimensional.jfrog.io/artifactory/maven" }
}

dependencies {
  implementation "gg.mixtape:kokusaika:1.0.0"
}
Kotlin
repositories {
  maven {
    name = "dimensional.fun"
    url = uri("https://dimensional.jfrog.io/artifactory/maven")
  }
}

dependencies {
  implementation("gg.mixtape:kokusaika:1.0.0")
}

๐Ÿš€ Usage

import kokusaika.Kokusaika
import kotlinx.serialization.json.Json
import java.util.*

fun main() {
  val kokusaika = Kokusaika {
    format = Json { }
    languagesPath = "/assets/languages" // path within the resources folder
    fallback = Locale.US
  }
  
  val myString = kokusaika[Locale.US]?.read<String>("hello")
  println(myString) // -> world
}
{
  "hello": "world"
}
Folder Structure
/resources
  /assets
    /languages
      list.json
      en-US.json

Copyright ยฉ mixtape bot 2019 - 2021 all rights reserved

About

๐ŸŒ simple internationalization for kotlin

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages