mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 00:16:51 +00:00
Use label_format in number_range input control
This commit is contained in:
@@ -112,7 +112,7 @@ function TextPart({ part, lang, oneline }: { part: PartData, lang: Record<string
|
||||
}
|
||||
|
||||
function resolveTranslate(translate: string, fallback: string | undefined, with_: any[] | undefined, lang: Record<string, string>): string {
|
||||
const str = lang[translate] ?? fallback
|
||||
const str = lang[translate] ?? fallback ?? translate
|
||||
if (typeof str !== 'string') return translate
|
||||
const params = with_?.map((c): string => {
|
||||
if (typeof c === 'string' || typeof c === 'number') return `${c}`
|
||||
|
||||
@@ -220,8 +220,7 @@ function InputControl({ input }: { input: any }) {
|
||||
}
|
||||
|
||||
if (type === 'number_range') {
|
||||
// TODO: use label_format
|
||||
const label = {translate: 'options.generic_value', with: [input.label ?? '', input.start ?? 0]}
|
||||
const label = {translate: input.label_format ?? 'options.generic_value', with: [input.label ?? '', input.start ?? 0]}
|
||||
return <div class="dialog-slider" style={`width: ${px(input.width ?? 200)}; height: ${px(20)};`}>
|
||||
<div class="dialog-slider-track"></div>
|
||||
<div class="dialog-slider-handle"></div>
|
||||
|
||||
Reference in New Issue
Block a user