forked from Shinonome/dots-hyprland
Add translation
This commit is contained in:
@@ -10,10 +10,11 @@ import { BluetoothIndicator, NetworkIndicator } from '../.commonwidgets/statusic
|
||||
import { setupCursorHover } from '../.widgetutils/cursorhover.js';
|
||||
import { MaterialIcon } from '../.commonwidgets/materialicon.js';
|
||||
import { sidebarOptionsStack } from './sideright.js';
|
||||
import { getString } from '../../i18n/i18n.js';
|
||||
|
||||
export const ToggleIconWifi = (props = {}) => Widget.Button({
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Wifi | Right-click to configure',
|
||||
tooltipText: getString('Wifi | Right-click to configure'),
|
||||
onClicked: () => Network.toggleWifi(),
|
||||
onSecondaryClickRelease: () => {
|
||||
execAsync(['bash', '-c', `${userOptions.apps.network}`]).catch(print);
|
||||
@@ -24,7 +25,7 @@ export const ToggleIconWifi = (props = {}) => Widget.Button({
|
||||
setupCursorHover(self);
|
||||
self.hook(Network, button => {
|
||||
button.toggleClassName('sidebar-button-active', [Network.wifi?.internet, Network.wired?.internet].includes('connected'))
|
||||
button.tooltipText = (`${Network.wifi?.ssid} | Right-click to configure` || 'Unknown');
|
||||
button.tooltipText = (`${Network.wifi?.ssid} | ${getString("Right-click to configure")}` || getString('Unknown'));
|
||||
});
|
||||
},
|
||||
...props,
|
||||
@@ -32,7 +33,7 @@ export const ToggleIconWifi = (props = {}) => Widget.Button({
|
||||
|
||||
export const ToggleIconBluetooth = (props = {}) => Widget.Button({
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Bluetooth | Right-click to configure',
|
||||
tooltipText: getString('Bluetooth | Right-click to configure'),
|
||||
onClicked: () => {
|
||||
const status = Bluetooth?.enabled;
|
||||
if (status)
|
||||
@@ -86,7 +87,7 @@ export const ModuleNightLight = async (props = {}) => {
|
||||
enabled: false,
|
||||
},
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Night Light',
|
||||
tooltipText: getString('Night Light'),
|
||||
onClicked: (self) => {
|
||||
self.attribute.enabled = !self.attribute.enabled;
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
@@ -122,7 +123,7 @@ export const ModuleCloudflareWarp = async (props = {}) => {
|
||||
enabled: false,
|
||||
},
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Cloudflare WARP',
|
||||
tooltipText: getString('Cloudflare WARP'),
|
||||
onClicked: (self) => {
|
||||
self.attribute.enabled = !self.attribute.enabled;
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
@@ -147,7 +148,7 @@ export const ModuleInvertColors = async (props = {}) => {
|
||||
const Hyprland = (await import('resource:///com/github/Aylur/ags/service/hyprland.js')).default;
|
||||
return Widget.Button({
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Color inversion',
|
||||
tooltipText: getString('Color inversion'),
|
||||
onClicked: (button) => {
|
||||
// const shaderPath = JSON.parse(exec('hyprctl -j getoption decoration:screen_shader')).str;
|
||||
Hyprland.messageAsync('j/getoption decoration:screen_shader')
|
||||
@@ -208,7 +209,7 @@ export const ModuleIdleInhibitor = (props = {}) => Widget.Button({ // TODO: Make
|
||||
enabled: false,
|
||||
},
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Keep system awake',
|
||||
tooltipText: getString('Keep system awake'),
|
||||
onClicked: (self) => {
|
||||
self.attribute.enabled = !self.attribute.enabled;
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
@@ -227,7 +228,7 @@ export const ModuleIdleInhibitor = (props = {}) => Widget.Button({ // TODO: Make
|
||||
export const ModuleReloadIcon = (props = {}) => Widget.Button({
|
||||
...props,
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Reload Environment config',
|
||||
tooltipText: getString('Reload Environment config'),
|
||||
onClicked: () => {
|
||||
execAsync(['bash', '-c', 'hyprctl reload || swaymsg reload &']);
|
||||
App.closeWindow('sideright');
|
||||
@@ -241,7 +242,7 @@ export const ModuleReloadIcon = (props = {}) => Widget.Button({
|
||||
export const ModuleSettingsIcon = (props = {}) => Widget.Button({
|
||||
...props,
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Open Settings',
|
||||
tooltipText: getString('Open Settings'),
|
||||
onClicked: () => {
|
||||
execAsync(['bash', '-c', `${userOptions.apps.settings}`, '&']);
|
||||
App.closeWindow('sideright');
|
||||
@@ -255,7 +256,7 @@ export const ModuleSettingsIcon = (props = {}) => Widget.Button({
|
||||
export const ModulePowerIcon = (props = {}) => Widget.Button({
|
||||
...props,
|
||||
className: 'txt-small sidebar-iconbutton',
|
||||
tooltipText: 'Session',
|
||||
tooltipText: getString('Session'),
|
||||
onClicked: () => {
|
||||
closeEverything();
|
||||
Utils.timeout(1, () => openWindowOnAllMonitors('session'));
|
||||
|
||||
Reference in New Issue
Block a user