1
0
forked from SPC/spc-site

Constants for language access

This commit is contained in:
Alexander Nozik 2023-01-09 11:24:11 +03:00
parent b11be7df2d
commit 92b031392a

View File

@ -56,13 +56,13 @@ internal val FortyDataRenderer: DataRenderer = object : DataRenderer {
override fun invoke(name: Name, data: Data<Any>) { override fun invoke(name: Name, data: Data<Any>) {
if (data.type == typeOf<HtmlFragment>()) { if (data.type == typeOf<HtmlFragment>()) {
data as Data<HtmlFragment> data as Data<HtmlFragment>
val languageMeta: Meta = DataRenderer.buildLanguageMeta(name) val languageMeta: Meta = Language.forName(name)
val dataMeta: Meta = if (languageMeta.isEmpty()) { val dataMeta: Meta = if (languageMeta.isEmpty()) {
data.meta data.meta
} else { } else {
data.meta.toMutableMeta().apply { data.meta.toMutableMeta().apply {
"languages" put languageMeta Language.LANGUAGES_KEY put languageMeta
} }
} }