Merge pull request #7 from NotMephisto/ryo

Translation, fix tray, and dynamic icon in OSD

Thanks to NotMephisto!!
This commit is contained in:
João Dias
2025-06-03 13:22:34 -03:00
committed by GitHub
4 changed files with 94 additions and 6 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ import { GLib } from "astal";
const i18nKeys = { const i18nKeys = {
"en_US": (await import("./lang/en_US")).default, "en_US": (await import("./lang/en_US")).default,
"pt_BR": (await import("./lang/pt_BR")).default "pt_BR": (await import("./lang/pt_BR")).default,
"ru_RU": (await import("./lang/ru_RU")).default
}; };
const languages: Array<string> = Object.keys(i18nKeys); const languages: Array<string> = Object.keys(i18nKeys);
+86
View File
@@ -0,0 +1,86 @@
import { i18nStruct } from "../struct";
export default {
language: "Русский (Российская Федерация)",
cancel: "Отменить",
accept: "Ок",
devices: "Устройства",
others: "Другие",
connected: "Подключён",
disconnected: "Отключён",
unknown: "Неизвестный",
connecting: "Подключение",
none: "Ничего",
limited: "Ограничен",
apps: "Приложения",
clear: "Очистить",
connect: "Подключиться",
disconnect: "Отключиться",
control_center: {
tiles: {
enabled: "Включить",
disabled: "Отключить",
more: "Больше",
network: {
network: "Инетрнет",
wireless: "Беспроводное",
wired: "Проводное"
},
recording: {
title: "Запись экрана",
disabled_desc: "Начать запись",
enabled_desc: "Остановить запись",
},
dnd: {
title: "Не беспокоить"
},
night_light: {
title: "Ночной свет",
default_desc: "Точность"
}
},
pages: {
more_settings: "Больше настроек",
sound: {
title: "Звук",
description: "Настройка вывода звука"
},
microphone: {
title: "Микрофон",
description: "Настройка ввода звука"
},
night_light: {
title: "Ночной свет",
description: "Контроль интенсивности фильтрации синего света",
gamma: "Гамма",
temperature: "Температура"
},
bluetooth: {
title: "Bluetooth",
description: "Управление Bluetooth устройствами",
new_devices: "Новые устройства",
adapters: "Адапреты",
paired_devices: "Привязанные устройства",
start_discovering: "Начать поиск",
stop_discovering: "Остановить поиск",
untrust_device: "Не доверять устройству",
unpair_device: "Отвязать устройство",
trust_device: "Доверять устройству",
pair_device: "Привязать устройство"
},
network: {
title: "Интернет",
interface: "Интерфейсы"
}
}
},
ask_popup: {
title: "Вопрос"
}
} as i18nStruct;
+3 -2
View File
@@ -15,8 +15,9 @@ export function Tray(): Gtk.Widget {
return new Widget.Box({ return new Widget.Box({
className: "tray", className: "tray",
visible: bind(astalTray, "items").as((items: Array<AstalTray.TrayItem>) => items.length > 0), visible: bind(astalTray, "items").as((items: Array<AstalTray.TrayItem>) => items.length > 0),
children: bind(astalTray, "items").as((items: Array<AstalTray.TrayItem>) => children: bind(astalTray, "items").as((items: Array<AstalTray.TrayItem>) => items
items.map((item: AstalTray.TrayItem) => .filter(item => item?.gicon)
.map((item: AstalTray.TrayItem) =>
new Widget.Box({ new Widget.Box({
className: "item", className: "item",
child: Variable.derive( child: Variable.derive(
+3 -3
View File
@@ -44,10 +44,10 @@ export const OSD = (mon: number) => {
child: new Widget.Box({ child: new Widget.Box({
className: "osd", className: "osd",
children: [ children: [
new Widget.Label({ new Widget.Icon({
className: "icon", className: "icon",
label: osdIcon icon: bind(Wireplumber.getDefault().getDefaultSink(), "volumeIcon")
} as Widget.LabelProps), } as Widget.IconProps),
new Widget.Box({ new Widget.Box({
className: "volume", className: "volume",
orientation: Gtk.Orientation.VERTICAL, orientation: Gtk.Orientation.VERTICAL,