i18nliner-kt | I18n made simple - for Kotlin | Internationalization library
kandi X-RAY | i18nliner-kt Summary
kandi X-RAY | i18nliner-kt Summary
i18nliner-kt is a Kotlin library typically used in Utilities, Internationalization, React applications. i18nliner-kt has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.
I18n made simple - for Kotlin! (still in beta)
I18n made simple - for Kotlin! (still in beta)
Support
Quality
Security
License
Reuse
Support
i18nliner-kt has a low active ecosystem.
It has 9 star(s) with 3 fork(s). There are 2 watchers for this library.
It had no major release in the last 6 months.
i18nliner-kt has no issues reported. There are no pull requests.
It has a neutral sentiment in the developer community.
The latest version of i18nliner-kt is current.
Quality
i18nliner-kt has no bugs reported.
Security
i18nliner-kt has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
License
i18nliner-kt is licensed under the MIT License. This license is Permissive.
Permissive licenses have the least restrictions, and you can use them in most projects.
Reuse
i18nliner-kt releases are not available. You will need to build from source code and install.
Installation instructions are not available. Examples and code snippets are available.
Top functions reviewed by kandi - BETA
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of i18nliner-kt
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of i18nliner-kt
i18nliner-kt Key Features
No Key Features are available at this moment for i18nliner-kt.
i18nliner-kt Examples and Code Snippets
No Code Snippets are available at this moment for i18nliner-kt.
Community Discussions
Trending Discussions on i18nliner-kt
QUESTION
How to support i18n with kotlin js
Asked 2020-Nov-11 at 12:55
i'm currently trying to add i18n support to a kotlin js project (no react).
...ANSWER
Answered 2020-Nov-11 at 12:55class LanguageSupport(private val folder: String = "", private val lang: String) {
private lateinit var currentLang: Json
private val languageMutableStateFlow = MutableStateFlow(
LanguageSupportState.LanguageInit
)
val languageStateFlow: StateFlow = languageMutableStateFlow
init {
loadJSON()
}
fun get(key: String): String {
val value = currentLang[key]
check(value != null) {
throw Exception("key not found to load language definition")
}
return if (value is String) {
value
} else {
throw Exception("value of key is not a string")
}
}
fun get(key: String, vararg placeholders: String): String {
val value = currentLang[key]
check(value != null) {
throw Exception("key not found to load language definition")
}
return if (value is String) {
var finalValue: String = value
for (item in placeholders) {
finalValue = finalValue.replaceFirst(PLACEHOLDER, item)
}
finalValue
} else {
throw Exception("value of key is not a string")
}
}
private fun loadJSON() {
val xobj = XMLHttpRequest()
xobj.overrideMimeType("application/json")
xobj.open("GET", "${folder}test_${lang}.json", true)
xobj.onreadystatechange = {
if (xobj.readyState.toInt() == 4 && xobj.status.toInt() == 200) {
// Required use of an anonymous callback
// as .open() will NOT return a value but simply returns undefined in asynchronous mode
currentLang = JSON.parse(xobj.responseText)
languageMutableStateFlow.value = LanguageSupportState.LanguageLoaded
}
}
xobj.send(null)
}
companion object {
const val PLACEHOLDER = "%s"
}
}
sealed class LanguageSupportState {
object LanguageLoaded : LanguageSupportState()
object LanguageError : LanguageSupportState()
object LanguageInit : LanguageSupportState()
}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install i18nliner-kt
You can download it from GitHub.
Support
For any new features, suggestions and bugs create an issue on GitHub.
If you have any questions check and ask questions on community page Stack Overflow .
Find more information at:
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page