mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-26 09:40:26 +00:00
improvements in resources
This commit is contained in:
@@ -39,7 +39,10 @@ class StringResource(
|
||||
fun build() = StringResource(default, map.toMap())
|
||||
}
|
||||
|
||||
fun translation(languageCode: IetfLang): String {
|
||||
fun translation(languageCode: IetfLang?): String {
|
||||
if (languageCode == null) {
|
||||
return default
|
||||
}
|
||||
map[languageCode] ?.let { return it.value }
|
||||
|
||||
return languageCode.parentLang ?.let {
|
||||
|
||||
Reference in New Issue
Block a user