diff --git a/CMakeLists.txt b/CMakeLists.txt index bab1388..b954f1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,10 @@ include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMSetupVersion) find_package(Qt6 REQUIRED COMPONENTS Core) -find_package(KF6 REQUIRED COMPONENTS FileMetaData) +find_package(KF6 REQUIRED COMPONENTS FileMetaData I18n) add_subdirectory(lib) add_subdirectory(extractor) add_subdirectory(fileitemaction) + +ki18n_install(po) diff --git a/fileitemaction/CMakeLists.txt b/fileitemaction/CMakeLists.txt index 69557c9..4c50043 100644 --- a/fileitemaction/CMakeLists.txt +++ b/fileitemaction/CMakeLists.txt @@ -1,5 +1,7 @@ find_package(KF6 REQUIRED COMPONENTS KIO WidgetsAddons) +add_definitions(-DTRANSLATION_DOMAIN="kdenote") + add_library(kdenote_fileitemaction MODULE denote_fileitemaction.cpp ) @@ -8,6 +10,7 @@ target_link_libraries(kdenote_fileitemaction kdenote_lib KF6::KIOWidgets KF6::WidgetsAddons + KF6::I18n Qt6::Core Qt6::Widgets ) diff --git a/fileitemaction/denote_fileitemaction.cpp b/fileitemaction/denote_fileitemaction.cpp index a728661..202c3f2 100644 --- a/fileitemaction/denote_fileitemaction.cpp +++ b/fileitemaction/denote_fileitemaction.cpp @@ -4,6 +4,7 @@ #include "denote_metadata.h" #include +#include #include #include @@ -37,7 +38,7 @@ QList DenoteFileItemAction::actions(const KFileItemListProperties &fi // Directory: show "New Denote File..." if (item.isDir()) { - auto *action = new QAction(QStringLiteral("New Denote File..."), parentWidget); + auto *action = new QAction(i18n("New Denote File..."), parentWidget); action->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); const QString dirPath = item.localPath(); @@ -52,7 +53,7 @@ QList DenoteFileItemAction::actions(const KFileItemListProperties &fi if (meta.isValid()) return {}; - auto *action = new QAction(QStringLiteral("Rename with Denote..."), parentWidget); + auto *action = new QAction(i18n("Rename with Denote..."), parentWidget); action->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename"))); const KFileItemList items = fileItemInfos.items(); @@ -93,7 +94,7 @@ void DenoteFileItemAction::renameWithDenote(const KFileItemList &items, QWidget // Build dialog QDialog dialog(parentWidget); - dialog.setWindowTitle(QStringLiteral("Rename with Denote")); + dialog.setWindowTitle(i18n("Rename with Denote")); // Size to 33% of screen width (accounts for HiDPI) if (auto *screen = dialog.screen()) { dialog.setMinimumWidth(screen->availableGeometry().width() / 3); @@ -103,15 +104,15 @@ void DenoteFileItemAction::renameWithDenote(const KFileItemList &items, QWidget auto *form = new QFormLayout(); auto *titleEdit = new QLineEdit(defaultTitle); - form->addRow(QStringLiteral("Title:"), titleEdit); + form->addRow(i18n("Title:"), titleEdit); auto *tagsEdit = new QLineEdit(); - tagsEdit->setPlaceholderText(QStringLiteral("tag1, tag2, tag3")); - form->addRow(QStringLiteral("Tags:"), tagsEdit); + tagsEdit->setPlaceholderText(i18n("tag1, tag2, tag3")); + form->addRow(i18n("Tags:"), tagsEdit); auto *sigEdit = new QLineEdit(); - sigEdit->setPlaceholderText(QStringLiteral("(optional)")); - form->addRow(QStringLiteral("Signature:"), sigEdit); + sigEdit->setPlaceholderText(i18n("(optional)")); + form->addRow(i18n("Signature:"), sigEdit); layout->addLayout(form); @@ -172,7 +173,7 @@ void DenoteFileItemAction::renameWithDenote(const KFileItemList &items, QWidget void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *parentWidget) { QDialog dialog(parentWidget); - dialog.setWindowTitle(QStringLiteral("New Denote File")); + dialog.setWindowTitle(i18n("New Denote File")); if (auto *screen = dialog.screen()) { dialog.setMinimumWidth(screen->availableGeometry().width() / 3); } @@ -181,22 +182,22 @@ void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *par auto *form = new QFormLayout(); auto *titleEdit = new QLineEdit(); - titleEdit->setPlaceholderText(QStringLiteral("Note title")); - form->addRow(QStringLiteral("Title:"), titleEdit); + titleEdit->setPlaceholderText(i18n("Note title")); + form->addRow(i18n("Title:"), titleEdit); auto *tagsEdit = new QLineEdit(); - tagsEdit->setPlaceholderText(QStringLiteral("tag1, tag2, tag3")); - form->addRow(QStringLiteral("Tags:"), tagsEdit); + tagsEdit->setPlaceholderText(i18n("tag1, tag2, tag3")); + form->addRow(i18n("Tags:"), tagsEdit); auto *sigEdit = new QLineEdit(); - sigEdit->setPlaceholderText(QStringLiteral("(optional)")); - form->addRow(QStringLiteral("Signature:"), sigEdit); + sigEdit->setPlaceholderText(i18n("(optional)")); + form->addRow(i18n("Signature:"), sigEdit); auto *extCombo = new QComboBox(); - extCombo->addItem(QStringLiteral("Markdown"), QStringLiteral(".md")); - extCombo->addItem(QStringLiteral("Emacs org-mode"), QStringLiteral(".org")); - extCombo->addItem(QStringLiteral("Plain Text"), QStringLiteral(".txt")); - form->addRow(QStringLiteral("Format:"), extCombo); + extCombo->addItem(i18n("Markdown"), QStringLiteral(".md")); + extCombo->addItem(i18n("Emacs org-mode"), QStringLiteral(".org")); + extCombo->addItem(i18n("Plain Text"), QStringLiteral(".txt")); + form->addRow(i18n("Format:"), extCombo); layout->addLayout(form); diff --git a/po/de/kdenote.po b/po/de/kdenote.po new file mode 100644 index 0000000..6561e71 --- /dev/null +++ b/po/de/kdenote.po @@ -0,0 +1,58 @@ +# German translations for kdenote +# Copyright (C) 2026 +# This file is distributed under the same license as the kdenote package. +# +msgid "" +msgstr "" +"Project-Id-Version: kdenote 0.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-07-12 00:00+0000\n" +"PO-Revision-Date: 2026-07-12 00:00+0000\n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "New Denote File..." +msgstr "Neue Denote-Datei..." + +msgid "Rename with Denote..." +msgstr "Mit Denote umbenennen..." + +msgid "Rename with Denote" +msgstr "Mit Denote umbenennen" + +msgid "New Denote File" +msgstr "Neue Denote-Datei" + +msgid "Title:" +msgstr "Titel:" + +msgid "Tags:" +msgstr "Schlagw\xc3\xb6rter:" + +msgid "Signature:" +msgstr "Signatur:" + +msgid "Format:" +msgstr "Format:" + +msgid "tag1, tag2, tag3" +msgstr "tag1, tag2, tag3" + +msgid "(optional)" +msgstr "(optional)" + +msgid "Note title" +msgstr "Notiz-Titel" + +msgid "Markdown" +msgstr "Markdown" + +msgid "Emacs org-mode" +msgstr "Emacs Org-Mode" + +msgid "Plain Text" +msgstr "Klartext"