mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-25 16:16:50 +00:00
Add locale support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { AbstractNode, NodeMods, RenderOptions } from "./AbstractNode";
|
||||
import { Path } from "../model/Path";
|
||||
import { TreeView } from "../view/TreeView";
|
||||
import { locale } from "../Registries";
|
||||
|
||||
export class BooleanNode extends AbstractNode<boolean> {
|
||||
|
||||
@@ -17,9 +18,11 @@ export class BooleanNode extends AbstractNode<boolean> {
|
||||
const trueButton = view.registerClick(el => {
|
||||
view.model.set(path, !this.force() && value === true ? undefined : true)
|
||||
})
|
||||
return `${options?.hideLabel ? `` : `<label>${path.last()}</label>`}
|
||||
<button${value === false ? ' style="font-weight: bold"' : ' '} data-id="${falseButton}">False</button>
|
||||
<button${value === true ? ' style="font-weight: bold"' : ' '} data-id="${trueButton}">True</button>`
|
||||
return `${options?.hideLabel ? `` : `<label>${locale(path)}</label>`}
|
||||
<button${value === false ? ' style="font-weight: bold"' : ' '}
|
||||
data-id="${falseButton}">${locale('false')}</button>
|
||||
<button${value === true ? ' style="font-weight: bold"' : ' '}
|
||||
data-id="${trueButton}">${locale('true')}</button>`
|
||||
}
|
||||
|
||||
getClassName() {
|
||||
|
||||
Reference in New Issue
Block a user