ags(i18n): finally use i18n system!

This commit is contained in:
retrozinndev
2025-03-09 16:04:48 -03:00
parent 59ef5e4aa7
commit 03813021a8
11 changed files with 113 additions and 44 deletions
+4 -3
View File
@@ -2,6 +2,7 @@ import { Binding } from "astal";
import { PopupWindow, PopupWindowProps } from "./PopupWindow";
import { Astal, Gtk, Widget } from "astal/gtk3";
import { Separator } from "./Separator";
import { tr } from "../i18n/intl";
export type AskPopupProps = {
title?: string | Binding<string | undefined>;
@@ -22,7 +23,7 @@ export function AskPopup(props: AskPopupProps) {
new Widget.Button({
className: "cancel",
hexpand: true,
label: props.cancelText || "Cancel",
label: props.cancelText || tr("ask_popup.options.cancel") || "Cancel",
onClick: (_) => {
window.destroy();
props.onCancel && props.onCancel();
@@ -31,7 +32,7 @@ export function AskPopup(props: AskPopupProps) {
new Widget.Button({
className: "accept",
hexpand: true,
label: props.acceptText || "Ok",
label: props.acceptText || tr("ask_popup.options.accept") || "Ok",
onClick: (_) => {
window.destroy();
props.onAccept && props.onAccept();
@@ -57,7 +58,7 @@ export function AskPopup(props: AskPopupProps) {
new Widget.Label({
className: "title",
visible: Boolean(props.title),
label: props.title || ""
label: props.title || tr("ask_popup.title") || "Question"
} as Widget.LabelProps),
Separator({
alpha: .2,