forked from SPC/spc-site
Constants for language access
This commit is contained in:
parent
b11be7df2d
commit
92b031392a
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user