Skip to content
Localization library for Kotlin Multiplatform. Tailor-made for Accent.
Groovy Kotlin Ruby Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
android-ktx
gradle/wrapper
jenkins-jobs
kword-plugin
kword
swift-extensions
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
LICENSE.md
README.md
Trikot.kword.podspec
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Trikot.KWord

Trikot.KWord provides the necessary tools to make localisation happen in Kotlin Multiplatform application.

  • A gradle plugin that generates Kotlin enum from Accent localisation files
  • Kotlin Multiplatform dependencies to interact with the localisation
  • Swift and Android extensions to change current locale to use.

Plugin usage

plugins {
    id 'mirego.kword' version '0.1'
}

kword {
    translationFile 'src/commonMain/resources/translations/translation.fr.json'
    enumClassName 'com.myproject.common.localization.KWordTranslation'
    generatedDir 'src/commonMain/generated'
}

kotlin {
    //...
    sourceSets {
        commonMain {
            dependencies {
                implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
            }
            kotlin.srcDir(kword.generatedDir)
        }
        //...
     }
}

tasks.findAll { it.name.startsWith('compile') }.each { it.dependsOn('kwordGenerateEnum') }

This will generate an enum Named KWordTranslation containing all the keys contained in your translationFile.

KWord usage

Common Code

val myString = KWord[KWordTranslation.HELLO_WORLD]

Installation

Import dependencies
    api "com.mirego.trikot:kword:$trikot_kword_version"
    jvm "com.mirego.trikot:kword-jvm:$trikot_kword_version"
    js "com.mirego.trikot:kword-js:$trikot_kword_version"
    iosx64 "com.mirego.trikot:kword-iosx64:$trikot_kword_version"
    iosarm64 "com.mirego.trikot:kword-iosarm64:$trikot_kword_version"

iOS

See swift extensions

Android

See android extensions

License

Trikot.kword is © 2018-2019 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.

You can’t perform that action at this time.