Add translation

This commit is contained in:
月月
2024-09-16 16:40:54 +08:00
parent 73334862c6
commit 69adcbbda5
20 changed files with 312 additions and 123 deletions
@@ -8,6 +8,7 @@ import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
import { setupCursorHover } from '../../.widgetutils/cursorhover.js';
import Notification from '../../.commonwidgets/notification.js';
import { ConfigToggle } from '../../.commonwidgets/configwidgets.js';
import { getString } from '../../../i18n/i18n.js';
export default (props) => {
const notifEmptyContent = Box({
@@ -22,7 +23,7 @@ export default (props) => {
className: 'spacing-v-5 txt-subtext',
children: [
MaterialIcon('notifications_active', 'gigantic'),
Label({ label: 'No notifications', className: 'txt-small' }),
Label({ label: getString('No notifications'), className: 'txt-small' }),
]
}),
]
@@ -82,7 +83,7 @@ export default (props) => {
}),
setup: setupCursorHover,
});
const silenceButton = ListActionButton('notifications_paused', 'Silence', (self) => {
const silenceButton = ListActionButton('notifications_paused', getString('Silence'), (self) => {
Notifications.dnd = !Notifications.dnd;
self.toggleClassName('notif-listaction-btn-enabled', Notifications.dnd);
});
@@ -101,7 +102,7 @@ export default (props) => {
setup: (self) => self.hook(Notifications, (self) => {
self.revealChild = Notifications.notifications.length > 0;
}),
child: ListActionButton('clear_all', 'Clear', () => {
child: ListActionButton('clear_all', getString('Clear'), () => {
Notifications.clear();
const kids = notificationList.get_children();
for (let i = 0; i < kids.length; i++) {
@@ -114,7 +115,7 @@ export default (props) => {
attribute: {
updateCount: (self) => {
const count = Notifications.notifications.length;
if (count > 0) self.label = `${count} notifications`;
if (count > 0) self.label = `${count} ${getString("notifications")}`;
else self.label = '';
},
},