diff --git a/src/dialog/vsettingsdialog.cpp b/src/dialog/vsettingsdialog.cpp index c24ebf8e..bf609a91 100644 --- a/src/dialog/vsettingsdialog.cpp +++ b/src/dialog/vsettingsdialog.cpp @@ -38,7 +38,7 @@ void VSettingsDialog::loadConfiguration() return; err: VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to load configuration."), "", + tr("Fail to load configuration."), "", QMessageBox::Ok, QMessageBox::Ok, NULL); QMetaObject::invokeMethod(this, "reject", Qt::QueuedConnection); } @@ -57,7 +57,7 @@ void VSettingsDialog::saveConfiguration() return; err: VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to save configuration. Please try it again."), "", + tr("Fail to save configuration. Please try it again."), "", QMessageBox::Ok, QMessageBox::Ok, NULL); } diff --git a/src/translations/vnote_zh_CN.qm b/src/translations/vnote_zh_CN.qm index 6a5b7e54..252c9c08 100644 Binary files a/src/translations/vnote_zh_CN.qm and b/src/translations/vnote_zh_CN.qm differ diff --git a/src/translations/vnote_zh_CN.ts b/src/translations/vnote_zh_CN.ts index 4f571299..e1a7ddb9 100644 --- a/src/translations/vnote_zh_CN.ts +++ b/src/translations/vnote_zh_CN.ts @@ -6,7 +6,7 @@ Directory &name: - 目录名 (&V): + 目录名 (&N): @@ -16,6 +16,11 @@ Warning 警告 + + + Fail to copy image %1. + 复制图片失败: %1。 + Please check if there already exists a file with the same name and then manually copy it. @@ -105,16 +110,63 @@ Warning 警告 + + + Fail to open notebook %1. + 打开笔记本失败: %1。 + + + + Fail to open directory %1. + 打开目录失败: %1。 + + + + Create sub-directory under %1. + 在目录 %1 中新建一个子目录。 + + + + + Directory &name: + 目录名 (&N): + Create Directory 新建目录 + + + Name already exists under %1. Please choose another name. + 该目录名已存在于目录 %1 中。请选择另一个名字。 + + + + + Fail to create directory %1. + 新建目录失败: %1。 + + + + Create root directory in notebook %1. + 在笔记本 %1 中新建根目录。 + Create Root Directory 新建根目录 + + + Name already exists in notebook %1. Please choose another name. + 该目录名已存在于笔记本 %1 中。请选择另一个名字。 + + + + Are you sure to delete directory %1? + 确认删除目录: %1? + This will delete any files under this directory. @@ -125,6 +177,21 @@ Directory Information 目录信息 + + + Fail to rename directory %1. + 重命名目录失败: %1。 + + + + Fail to copy directory %1. + 复制目录失败: %1。 + + + + Please check if there alread exists a directory with the same name. + 请检查目标文件夹中是否已经存在同名文件夹。 + VEditTab @@ -133,6 +200,11 @@ Information 信息 + + + Note %1 has been modified. + 笔记 %1 已被更改。 + Do you want to save your changes? @@ -150,6 +222,16 @@ Fail to save note. 保存笔记失败。 + + + %1 being written has been removed. + 要写入的文件已被删除: %1。 + + + + Fail to write to disk when saving a note. Please try it again. + 保存笔记时,写入文件失败。请稍后再试。 + VEditWindow @@ -279,18 +361,58 @@ Note Information 笔记信息 + + + Create a note in %1. + 在目录 %1 中新建一个笔记。 + + + + Note &name: + 笔记名 (&N): + + + + Create Note + 新建笔记 + + + + Name already exists. Please choose another name. + 该笔记本名已存在。请选择另一个名字。 + - + Warning 警告 + + + Fail to create note %1. + 新建笔记失败: %1。 + + Are you sure to delete note %1? + 确认删除笔记: %1? + + + This may be unrecoverable! 该操作不可撤消! + + + The renaming will change the note type. + 重命名会更改笔记类型。 + + + + You should close the note %1 before continue. + 请在继续前先关闭笔记: %1。 + VFindReplaceDialog @@ -720,6 +842,11 @@ Import Notes From File 导入文件 + + + Imported notes: %1 succeed, %2 failed. + 已导入笔记: %1 成功, %2 失败。 + Use system's background color configuration for Markdown rendering @@ -961,6 +1088,16 @@ Visit https://github.com/tamlok/vnote.git for more information. Warning 警告 + + + Are you sure to delete notebook %1? + 确认删除笔记本: %1? + + + + This will delete any files in this notebook (%1). + 该操作会删除该笔记本中的所有文件 (%1)。 + Notebook Information @@ -985,5 +1122,15 @@ Visit https://github.com/tamlok/vnote.git for more information. Warning 警告 + + + Fail to load configuration. + 读取配置失败。 + + + + Fail to save configuration. Please try it again. + 保存配置失败。请稍后再试。 + diff --git a/src/vdirectory.cpp b/src/vdirectory.cpp index 5059f6a5..09dd097f 100644 --- a/src/vdirectory.cpp +++ b/src/vdirectory.cpp @@ -522,7 +522,7 @@ VFile *VDirectory::copyFile(VDirectory *p_destDir, const QString &p_destName, nrPasted++; } else { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to copy image %1.").arg(images[i]), + tr("Fail to copy image %1.").arg(images[i]), tr("Please check if there already exists a file with the same name and then manually copy it."), QMessageBox::Ok, QMessageBox::Ok, NULL); } diff --git a/src/vdirectorytree.cpp b/src/vdirectorytree.cpp index 0cec293a..f39249fe 100644 --- a/src/vdirectorytree.cpp +++ b/src/vdirectorytree.cpp @@ -91,7 +91,7 @@ void VDirectoryTree::setNotebook(VNotebook *p_notebook) } if (!m_notebook->open()) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to open notebook %1.").arg(m_notebook->getName()), "", + tr("Fail to open notebook %1.").arg(m_notebook->getName()), "", QMessageBox::Ok, QMessageBox::Ok, this); clear(); return; @@ -134,7 +134,7 @@ void VDirectoryTree::updateDirectoryTreeOne(QTreeWidgetItem *p_parent, int depth VDirectory *dir = getVDirectory(p_parent); if (!dir->open()) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to open directory %1.").arg(dir->getName()), "", + tr("Fail to open directory %1.").arg(dir->getName()), "", QMessageBox::Ok, QMessageBox::Ok, this); return; } @@ -295,8 +295,8 @@ void VDirectoryTree::newSubDirectory() } VDirectory *curDir = getVDirectory(curItem); - QString info = QString("Create sub-directory under %1.").arg(curDir->getName()); - QString text("Directory &name:"); + QString info = tr("Create sub-directory under %1.").arg(curDir->getName()); + QString text(tr("Directory &name:")); QString defaultText("new_directory"); do { @@ -304,14 +304,14 @@ void VDirectoryTree::newSubDirectory() if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (curDir->findSubDirectory(name)) { - info = QString("Name already exists under %1. Please choose another name.").arg(curDir->getName()); + info = tr("Name already exists under %1. Please choose another name.").arg(curDir->getName()); defaultText = name; continue; } VDirectory *subDir = curDir->createSubDirectory(name); if (!subDir) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to create directory %1.").arg(name), "", + tr("Fail to create directory %1.").arg(name), "", QMessageBox::Ok, QMessageBox::Ok, this); return; } @@ -327,8 +327,8 @@ void VDirectoryTree::newRootDirectory() if (!m_notebook) { return; } - QString info = QString("Create root directory in notebook %1.").arg(m_notebook->getName()); - QString text("Directory &name:"); + QString info = tr("Create root directory in notebook %1.").arg(m_notebook->getName()); + QString text(tr("Directory &name:")); QString defaultText("new_directory"); VDirectory *rootDir = m_notebook->getRootDir(); do { @@ -336,14 +336,14 @@ void VDirectoryTree::newRootDirectory() if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (rootDir->findSubDirectory(name)) { - info = QString("Name already exists in notebook %1. Please choose another name.").arg(m_notebook->getName()); + info = tr("Name already exists in notebook %1. Please choose another name.").arg(m_notebook->getName()); defaultText = name; continue; } VDirectory *subDir = rootDir->createSubDirectory(name); if (!subDir) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to create directory %1.").arg(name), "", + tr("Fail to create directory %1.").arg(name), "", QMessageBox::Ok, QMessageBox::Ok, this); return; } @@ -362,7 +362,7 @@ void VDirectoryTree::deleteDirectory() } VDirectory *curDir = getVDirectory(curItem); int ret = VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Are you sure to delete directory %1?").arg(curDir->getName()), + tr("Are you sure to delete directory %1?").arg(curDir->getName()), tr("This will delete any files under this directory."), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok, this); if (ret == QMessageBox::Ok) { @@ -410,7 +410,7 @@ void VDirectoryTree::editDirectoryInfo() } if (!curDir->rename(name)) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to rename directory %1.").arg(curName), "", + tr("Fail to rename directory %1.").arg(curName), "", QMessageBox::Ok, QMessageBox::Ok, this); return; } @@ -552,8 +552,8 @@ bool VDirectoryTree::copyDirectory(VDirectory *p_destDir, const QString &p_destN emit directoryUpdated(destDir); } else { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to copy directory %1.").arg(srcName), - QString("Please check if there alread exists a directory with the same name."), + tr("Fail to copy directory %1.").arg(srcName), + tr("Please check if there alread exists a directory with the same name."), QMessageBox::Ok, QMessageBox::Ok, this); } diff --git a/src/vedittab.cpp b/src/vedittab.cpp index 1ee11d2f..f2f8e426 100644 --- a/src/vedittab.cpp +++ b/src/vedittab.cpp @@ -206,7 +206,7 @@ void VEditTab::readFile() if (m_textEditor->isModified()) { // Prompt to save the changes int ret = VUtils::showMessage(QMessageBox::Information, tr("Information"), - QString("Note %1 has been modified.").arg(m_file->getName()), + tr("Note %1 has been modified.").arg(m_file->getName()), tr("Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save, this); @@ -241,7 +241,7 @@ bool VEditTab::saveFile() if (!QFile(filePath).exists()) { qWarning() << filePath << "being written has been removed"; VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note."), - QString("%1 being written has been removed.").arg(filePath), + tr("%1 being written has been removed.").arg(filePath), QMessageBox::Ok, QMessageBox::Ok, this); return false; } @@ -249,7 +249,7 @@ bool VEditTab::saveFile() ret = m_file->save(); if (!ret) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note."), - QString("Fail to write to disk when saving a note. Please try it again."), + tr("Fail to write to disk when saving a note. Please try it again."), QMessageBox::Ok, QMessageBox::Ok, this); m_textEditor->setModified(true); } diff --git a/src/vfilelist.cpp b/src/vfilelist.cpp index bb511254..0be3255e 100644 --- a/src/vfilelist.cpp +++ b/src/vfilelist.cpp @@ -173,22 +173,22 @@ void VFileList::newFile() if (!m_directory) { return; } - QString info = QString("Create a note under %1.").arg(m_directory->getName()); - QString text("&Note name:"); + QString info = tr("Create a note in %1.").arg(m_directory->getName()); + QString text(tr("Note &name:")); QString defaultText("new_note"); do { - VNewFileDialog dialog(QString("Create Note"), info, text, defaultText, this); + VNewFileDialog dialog(tr("Create Note"), info, text, defaultText, this); if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (m_directory->findFile(name)) { - info = "Name already exists. Please choose another name."; + info = tr("Name already exists. Please choose another name."); defaultText = name; continue; } VFile *file = m_directory->createFile(name); if (!file) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Fail to create note %1.").arg(name), "", + tr("Fail to create note %1.").arg(name), "", QMessageBox::Ok, QMessageBox::Ok, this); return; } @@ -245,7 +245,8 @@ void VFileList::deleteFile(VFile *p_file) VDirectory *dir = p_file->getDirectory(); QString fileName = p_file->getName(); int ret = VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Are you sure to delete note %1?").arg(fileName), tr("This may be unrecoverable!"), + tr("Are you sure to delete note %1?").arg(fileName), + tr("This may be unrecoverable!"), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok, this); if (ret == QMessageBox::Ok) { editArea->closeFile(p_file, true); @@ -430,8 +431,8 @@ bool VFileList::copyFile(VDirectory *p_destDir, const QString &p_destName, VFile if (docType != newDocType) { if (editArea->isFileOpened(p_file)) { int ret = VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("The renaming will change the note type."), - QString("You should close the note %1 before continue.").arg(p_file->getName()), + tr("The renaming will change the note type."), + tr("You should close the note %1 before continue.").arg(p_file->getName()), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok, this); if (QMessageBox::Ok == ret) { if (!editArea->closeFile(p_file, false)) { diff --git a/src/vmainwindow.cpp b/src/vmainwindow.cpp index 49cf05ed..102735f5 100644 --- a/src/vmainwindow.cpp +++ b/src/vmainwindow.cpp @@ -540,7 +540,7 @@ void VMainWindow::importNoteFromFile() } } QMessageBox msgBox(QMessageBox::Information, tr("Import Notes From File"), - QString("Imported notes: %1 succeed, %2 failed.") + tr("Imported notes: %1 succeed, %2 failed.") .arg(files.size() - failedFiles.size()).arg(failedFiles.size()), QMessageBox::Ok, this); if (!failedFiles.isEmpty()) { diff --git a/src/vnotebookselector.cpp b/src/vnotebookselector.cpp index 93060a2b..46682e0f 100644 --- a/src/vnotebookselector.cpp +++ b/src/vnotebookselector.cpp @@ -213,8 +213,8 @@ void VNotebookSelector::deleteNotebook() QString curPath = notebook->getPath(); int ret = VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - QString("Are you sure to delete notebook %1?").arg(curName), - QString("This will delete any files in this notebook (%1).").arg(curPath), + tr("Are you sure to delete notebook %1?").arg(curName), + tr("This will delete any files in this notebook (%1).").arg(curPath), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok, this); if (ret == QMessageBox::Ok) { m_editArea->closeFile(notebook, true);