aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/i18n
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-08-22 02:29:28 +0200
committerRobert Jaros <rjaros@finn.pl>2018-08-22 02:29:28 +0200
commit1d86be75d10f3d5330776f6bab090d14dd1aa3a0 (patch)
tree0266a496486a78e50a1a0119f653680174176541 /src/main/kotlin/pl/treksoft/kvision/i18n
parentdb000e6176e6e49a6a3f6b50ddbb8f0e5ae771a1 (diff)
downloadkvision-1d86be75d10f3d5330776f6bab090d14dd1aa3a0.tar.gz
kvision-1d86be75d10f3d5330776f6bab090d14dd1aa3a0.tar.bz2
kvision-1d86be75d10f3d5330776f6bab090d14dd1aa3a0.zip
I18n fixes for modal components.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/i18n')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
index 9d2ee1db..ee7bad86 100644
--- a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
@@ -127,7 +127,12 @@ object I18n {
return I18N_PLURAL_DELIMITER + singularKey + I18N_PLURAL_DELIMITER + pluralKey + I18N_PLURAL_DELIMITER + value
}
- internal fun trans(text: String): String {
+ /**
+ * A dynamic translation function.
+ * @param text text marked for a dynamic translation.
+ * @return translated text.
+ */
+ fun trans(text: String): String {
return if (text.startsWith(I18N_SINGLE_DELIMITER)) {
gettext(text.substring(I18N_SINGLE_DELIMITER.length))
} else if (text.startsWith(I18N_PLURAL_DELIMITER)) {
@@ -142,7 +147,12 @@ object I18n {
}
}
- internal fun trans(text: String?): String? {
+ /**
+ * A dynamic translation function.
+ * @param text text marked for a dynamic translation.
+ * @return translated text.
+ */
+ fun trans(text: String?): String? {
return text?.let {
trans(it)
}