Skip to content

Commit c2b11f4

Browse files
committed
Use label_format in number_range input control
1 parent 5113115 commit c2b11f4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/app/components/TextComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function TextPart({ part, lang, oneline }: { part: PartData, lang: Record<string
112112
}
113113

114114
function resolveTranslate(translate: string, fallback: string | undefined, with_: any[] | undefined, lang: Record<string, string>): string {
115-
const str = lang[translate] ?? fallback
115+
const str = lang[translate] ?? fallback ?? translate
116116
if (typeof str !== 'string') return translate
117117
const params = with_?.map((c): string => {
118118
if (typeof c === 'string' || typeof c === 'number') return `${c}`

src/app/components/previews/DialogPreview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ function InputControl({ input }: { input: any }) {
220220
}
221221

222222
if (type === 'number_range') {
223-
// TODO: use label_format
224-
const label = {translate: 'options.generic_value', with: [input.label ?? '', input.start ?? 0]}
223+
const label = {translate: input.label_format ?? 'options.generic_value', with: [input.label ?? '', input.start ?? 0]}
225224
return <div class="dialog-slider" style={`width: ${px(input.width ?? 200)}; height: ${px(20)};`}>
226225
<div class="dialog-slider-track"></div>
227226
<div class="dialog-slider-handle"></div>

src/styles/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,7 @@ hr {
19811981
display: flex;
19821982
align-items: center;
19831983
justify-content: center;
1984+
padding-bottom: var(--dialog-px);
19841985
}
19851986

19861987
.project-files {

0 commit comments

Comments
 (0)