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
+5 -4
View File
@@ -5,6 +5,7 @@ import { MaterialIcon } from '../.commonwidgets/materialicon.js';
import { TabContainer } from '../.commonwidgets/tabcontainer.js';
import Todo from "../../services/todo.js";
import { setupCursorHover } from '../.widgetutils/cursorhover.js';
import { getString } from '../../i18n/i18n.js';
const TodoListItem = (task, id, isDone, isEven = false) => {
const taskName = Widget.Label({
@@ -108,7 +109,7 @@ const todoItems = (isDone) => Widget.Scrollable({
className: 'txt txt-subtext',
children: [
MaterialIcon(`${isDone ? 'checklist' : 'check_circle'}`, 'gigantic'),
Label({ label: `${isDone ? 'Finished tasks will go here' : 'Nothing here!'}` })
Label({ label: `${isDone ? getString('Finished tasks will go here') : getString('Nothing here!')}` })
]
})
]
@@ -132,7 +133,7 @@ const UndoneTodoList = () => {
className: 'txt-small sidebar-todo-new',
halign: 'end',
vpack: 'center',
label: '+ New task',
label: getString('+ New task'),
setup: setupCursorHover,
onClicked: (self) => {
newTaskButton.revealChild = false;
@@ -166,7 +167,7 @@ const UndoneTodoList = () => {
// hexpand: true,
vpack: 'center',
className: 'txt-small sidebar-todo-entry',
placeholderText: 'Add a task...',
placeholderText: getString('Add a task...'),
onAccept: ({ text }) => {
if (text == '') return;
Todo.add(text)
@@ -216,7 +217,7 @@ const UndoneTodoList = () => {
export const TodoWidget = () => TabContainer({
icons: ['format_list_bulleted', 'task_alt'],
names: ['Unfinished', 'Done'],
names: [getString('Unfinished'), getString('Done')],
children: [
UndoneTodoList(),
todoItems(true),