mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
get back translations with android and java resources packages
This commit is contained in:
parent
0d01561476
commit
3bf6896296
@ -15,3 +15,7 @@ fun StringResource.translation(configuration: Configuration): String = translati
|
||||
)
|
||||
fun StringResource.translation(resources: Resources): String = translation(resources.configuration)
|
||||
fun StringResource.translation(context: Context): String = translation(context.resources)
|
||||
|
||||
fun Configuration.translation(resource: StringResource): String = resource.translation(this)
|
||||
fun Resources.translation(resource: StringResource): String = configuration.translation(resource)
|
||||
fun Context.translation(resource: StringResource): String = resources.translation(resource)
|
||||
|
@ -6,3 +6,5 @@ import java.util.Locale
|
||||
fun StringResource.translation(locale: Locale): String {
|
||||
return translation(locale.toIetfLanguageCode())
|
||||
}
|
||||
|
||||
fun Locale.translation(resource: StringResource): String = resource.translation(this)
|
Loading…
Reference in New Issue
Block a user