Simple Kotlin localization library.

Overview

Maven metadata URL

klocalizable

Simple Kotlin localization library.

Example

For simple words / sentences library has next DSL:

object Strings {
    val helloWorld: String by localized(
        default = "Hello, World!", localeProvider
    ) {
        Locale.RUSSIAN provides "Привет, мир!"
        Locale.UKRAINIAN provides "Привіт, світ"
    }
}

Word forms support

If you need to make different forms of words / sentences you can make next:

object Strings {
    object Human : KLocalizedForms<String>() {
        override val single: String by localized(localeProvider) {
            Locale.ENGLISH provides "Human"
            Locale.RUSSIAN provides "Человек"
            Locale.UKRAINIAN provides "Людина"
        }
        override val plural: String by localized(localeProvider) {
            Locale.ENGLISH provides "Humans"
            Locale.RUSSIAN provides "Люди"
            Locale.UKRAINIAN provides "Люди"
        }
    }
}

Also, if you need more forms you can extend KLocalizedForms and add yours.

Implementation

Put next in your build.gradle.kts:

repositories {
    maven("https://maven.y9vad9.com")
}
dependencies {
    implementation("com.y9vad9.localizable:klocalizable:$version")
}
You might also like...
A simple android library which helps you to create a curved bottom navigation

CurvedBottomNavigation A simple android library which helps you to create a curved bottom navigation DEMO Setup Update your module level build.gradle

A simple, lightweight and powerful field validation library for Android.
A simple, lightweight and powerful field validation library for Android.

Convalida Convalida - (Italian for "validation") Convalida is a simple, lightweight and powerful field validation library for Android. Documentation G

A simple android Twitter client written in Kotlin
A simple android Twitter client written in Kotlin

Blum Blum is an unofficial, simple, fast Twitter client written in Kotlin. This project is a complete rewrite of the Java version. Screenshot Build To

A simple plugin to patch the memory leak in Kotlin Gradle Plugin 1.5.0

kgp-150-leak-patcher A simple plugin to automatically patch the memory leak in Kotlin Gradle Plugin 1.5.0 in https://youtrack.jetbrains.com/issue/KT-4

Simple and extendable code highlighter in Kotlin Multiplatform

Kighlighter Simple and extendable code highlighter in Kotlin Multiplatform with a composable output to display the code highlighted on Android and Des

A simple MVI framework for Kotlin Multiplatform and Android
A simple MVI framework for Kotlin Multiplatform and Android

Orbit Multiplatform Get in touch What is Orbit Orbit is a Redux/MVI-like library - but without the baggage. It's so simple we think of it as MVVM+. Si

Simple Kotlin application that displays the currently available network interfaces on your machine

Network-Interface-Checker Simple Kotlin application that displays the currently available network interfaces on your machine. An executable jar can be

Nice and simple DSL for Espresso Compose UI testing in Kotlin
Nice and simple DSL for Espresso Compose UI testing in Kotlin

Kakao Compose Nice and simple DSL for Espresso Compose in Kotlin Benefits Readability Reusability Extensible DSL How to use it Create Screen Create yo

Starter project to create a simple RESTful web service in Kotlin

Modified: Adding Koin for DI Using JWT for authentication and authorization Dropping proprietary FlyAway tool Single Page Application support Starter

Owner
Vadim Yaroschuk
Kotlin frontend (android) & backend developer. Currently working on Warscape (@warscapeorg).
Vadim Yaroschuk
Kotlin script to prevent invalid conversion errors in projects with many localization files

Localization-Patterns-Checker Kotlin script to prevent invalid conversion errors

Бырна Алексей 1 Dec 26, 2021
Server & Web App of Tolgee localization toolkit

Server & Web App of Tolgee localization toolkit

Tolgee 534 Jan 8, 2023
LocalisationDemo - A sample project to demonstrate localization in android

LocalisationDemo This is a sample project to demonstrate localization in android

shubham423 0 Jan 8, 2022
Kbackend - A simple backend library for creating backends in Kotlin/Java

kbackend A simple backend library for creating backends in Kotlin/Java Setup Thi

Niclas 3 Feb 2, 2022
Kotlin multi-platform simple File I/O library

KmpIO This is a Kotlin multiplatform (KMP) library for basic Text file, Binary file, and zip/archive file IO. It was initially implemented with the an

Steven K Olson 9 Oct 1, 2022
Simple event library to communicate between Activity/Fragment and ViewModel

Setup dependencies { implementation "com.github.skgmn:viewmodelevent:1.1.0" } If you don't know how to access to GitHub Packges, please refer to

null 4 Apr 6, 2022
A Simple Android library to get the number of words and give you the time it will take you to finish an article/story.

MinRead A Simple Android library to get the number of words and give you the time it will take you to finish an article/story. Prerequisite Androidx K

Nwokocha wisdom maduabuchi 36 Nov 17, 2021
🌨️ Simple, intuitive, and opinionated command handling library for Kord

??️ Snow Simple, intuitive, and opinionated command handling library for Kord Why? Since I maintain two Discord bots, both in Kotlin, Nino and Noel (p

Noel ʕ •ᴥ•ʔ 1 Jan 16, 2022
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Achmad Ichsan Thaib 8 Nov 22, 2022
MiStoryView is a simple configurable library to integrate stories features into your social media android application.

MiStoryView MiStoryView is a simple configurable library to integrate stories features into your social media android application. Preview Key feature

MindInventory 35 Dec 22, 2022