Lammert Westerhoff
01/20/2021, 11:42 AMnrobi
01/20/2021, 11:52 AMLammert Westerhoff
01/20/2021, 12:00 PMalex009
01/20/2021, 12:26 PMJamie Craane
01/20/2021, 12:44 PMin commonMain we generate an expected function like this:
expect fun L.General.withParams(value0: String, value1: String): String
this is represented in the following way in the yaml file:
general:
withParams:
nl: "Een %1$s tekst met een %2$s"
en: "A piece of %1$s with a piece of %2$s"
in androidMain we generate an actual implementation which delegates to Android string resources:
actual fun L.General.withParams(value0: String, value1: String): String = localizationContext?.getString(R.string.l_general_withParams, value0, value1) ?: ""
The string resource files are also generated from the same input file:
<string name="l.general.withParams">A piece of %1$s with a piece of %2$s</string>
Hope this answers your question.alex009
01/20/2021, 1:46 PMlocalizationContext
?Jamie Craane
01/20/2021, 1:48 PMalex009
01/20/2021, 1:49 PMJamie Craane
01/20/2021, 1:52 PM