Skip to content

Commit

Permalink
web/translations: Encapsulate more "static" translations in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
borg42 committed Nov 29, 2024
1 parent 30cbd2b commit e0f3d17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions software/web/src/modules/em_debug/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export class EMDebug extends Component {
<PageHeader title={__("em_debug.content.em_debug")}/>
<FormRow label={__("em_debug.content.reset_description")} label_muted={__("em_debug.content.reset_description_muted")}>
<div class="input-group pb-2">
<Button variant="primary" className="form-control rounded-right mr-2" onClick={() => API.call('energy_manager/reset', {}, "")}>{__("em_debug.content.reset_em")}</Button>
<Button variant="primary" className="form-control rounded-left" onClick={() => API.call('energy_manager/reflash', {}, "")}>{__("em_debug.content.reflash_em")}</Button>
<Button variant="primary" className="form-control rounded-right mr-2" onClick={() => API.call('energy_manager/reset', {}, () => "")}>{__("em_debug.content.reset_em")}</Button>
<Button variant="primary" className="form-control rounded-left" onClick={() => API.call('energy_manager/reflash', {}, () => "")}>{__("em_debug.content.reflash_em")}</Button>
</div>
</FormRow>

Expand Down
2 changes: 1 addition & 1 deletion software/web/src/modules/em_sdcard/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class EMSDcard extends Component {
try {
await util.put("/energy_manager/sdcard_format", {"do_i_know_what_i_am_doing": true});
} catch (error) {
util.add_alert("sdcard_format_failed", "danger", __("em_sdcard.script.sdcard_format_error"), error);
util.add_alert("sdcard_format_failed", "danger", () => __("em_sdcard.script.sdcard_format_error"), () => error);
}
}}>{__("em_sdcard.content.format_sdcard")}</Button>
</FormRow>
Expand Down
2 changes: 1 addition & 1 deletion software/web/src/modules/heating/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Heating extends ConfigComponent<'heating/config', {status_ref?: Ref
<Button
className="form-control rounded-right"
variant="primary"
onClick={() => API.call('heating/reset_holding_time', {}, "")}>
onClick={() => API.call('heating/reset_holding_time', {}, () => "")}>
{__("heating.content.update_now")}
</Button>
</div>
Expand Down

0 comments on commit e0f3d17

Please sign in to comment.