Update i18n (#1714)

This commit is contained in:
Veronica Berglyd Olsen
2024-02-28 17:08:49 +01:00
committed by GitHub
11 changed files with 10409 additions and 10910 deletions
+1515 -1638
View File
File diff suppressed because it is too large Load Diff
+1658 -1781
View File
File diff suppressed because it is too large Load Diff
+1658 -1781
View File
File diff suppressed because it is too large Load Diff
+1657 -1780
View File
File diff suppressed because it is too large Load Diff
+1657 -1780
View File
File diff suppressed because it is too large Load Diff
+2198 -2139
View File
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,18 @@
{
"Synopsis": "Synopsis",
"Short Description": "Korte beschrijving",
"Comment": "Opmerking",
"Notes": "Notities",
"Tag": "Label",
"Point of View": "Perspectief",
"Focus": "Focus",
"Characters": "Personages",
"Plot": "Plot",
"Timeline": "Tijdslijn",
"Locations": "Locaties",
"Objects": "Objecten",
"Entities": "Entiteiten",
"Custom": "Aangepast",
"0": "nul",
"1": "één",
"2": "twee",
@@ -1,7 +1,18 @@
{
"Synopsis": "Sinopse",
"Short Description": "Descrição breve",
"Comment": "Comentários",
"Notes": "Notas",
"Tag": "Etiqueta",
"Point of View": "Ponto de vista",
"Focus": "Foco",
"Characters": "Personagens",
"Plot": "Trama",
"Timeline": "Linha do tempo",
"Locations": "Lugares",
"Objects": "Objetos",
"Entities": "Entidades",
"Custom": "Outros",
"0": "Zero",
"1": "Um",
"2": "Dois",
+2 -2
View File
@@ -68,9 +68,9 @@ class GuiAbout(QDialog):
self.nwInfo = VersionInfoWidget(self)
self.nwLicence = QLabel(self.tr("This application is licenced under {0}".format(
self.nwLicence = QLabel(self.tr("This application is licenced under {0}").format(
"<a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPL v3.0</a>"
)))
))
self.nwLicence.setOpenExternalLinks(True)
# Credits
+1 -1
View File
@@ -216,7 +216,7 @@ class _OverviewPage(NScrollablePage):
self.projForm.addRow("<b>{0}</b>".format(self.tr("Editing Time")), self.projEditTime)
self.projForm.addRow("<b>{0}</b>".format(self.tr("Word Count")), self.projWords)
self.projForm.addRow("<b>\u2026 {0}</b>".format(self.tr("In Novels")), self.projNovels)
self.projForm.addRow("<b>\u2026 {0}</b>".format(self.tr("In Notes ")), self.projNotes)
self.projForm.addRow("<b>\u2026 {0}</b>".format(self.tr("In Notes")), self.projNotes)
self.projForm.setContentsMargins(mPx, 0, 0, 0)
self.projForm.setHorizontalSpacing(hPx)
self.projForm.setVerticalSpacing(vPx)
+41 -8
View File
@@ -23,30 +23,63 @@ from __future__ import annotations
import sys
import pytest
from PyQt5.QtWidgets import qApp, QMessageBox
from collections.abc import Callable
from novelwriter import CONFIG, main
from tools import buildTestProject
from PyQt5.QtWidgets import QDialog, qApp, QMessageBox
from novelwriter import CONFIG, SHARED
from novelwriter.dialogs.about import GuiAbout
from novelwriter.dialogs.wordlist import GuiWordList
from novelwriter.dialogs.preferences import GuiPreferences
from novelwriter.dialogs.projectsettings import GuiProjectSettings
from novelwriter.tools.welcome import GuiWelcome
from novelwriter.tools.manuscript import GuiManuscript
from novelwriter.tools.dictionaries import GuiDictionaries
from novelwriter.tools.noveldetails import GuiNovelDetails
from novelwriter.tools.writingstats import GuiWritingStats
LANG_DATA = CONFIG.listLanguages(CONFIG.LANG_NW)
@pytest.mark.gui
@pytest.mark.skipif(not sys.platform.startswith("linux"), reason="Linux Only")
@pytest.mark.skipif(sys.platform != "linux", reason="Linux Only")
@pytest.mark.skipif(not LANG_DATA, reason="No i18n Data")
@pytest.mark.parametrize("language", [a for a, b in LANG_DATA])
def testI18n_Localisation(qtbot, monkeypatch, language, fncPath):
def testGuiI18n_Localisation(qtbot, monkeypatch, language, nwGUI, projPath):
"""Test loading the gui with a specific language."""
monkeypatch.setattr(QDialog, "exec_", lambda *a: None)
monkeypatch.setattr(QMessageBox, "exec_", lambda *a: None)
monkeypatch.setattr(QMessageBox, "result", lambda *a: QMessageBox.Yes)
# Set the test langauge
# Set the test language
CONFIG.guiLocale = language
CONFIG.initLocalisation(qApp)
nwGUI = main(["--testmode", f"--config={fncPath}", f"--data={fncPath}"])
qtbot.addWidget(nwGUI)
buildTestProject(nwGUI, projPath)
nwGUI.show()
def showDialog(func: Callable, dType: QDialog) -> None:
func()
qtbot.waitUntil(lambda: SHARED.findTopLevelWidget(dType) is not None, timeout=1000)
dialog = SHARED.findTopLevelWidget(dType)
assert isinstance(dialog, dType)
with qtbot.waitExposed(dialog):
dialog.show()
dialog.close()
showDialog(nwGUI.showWelcomeDialog, GuiWelcome)
showDialog(nwGUI.showPreferencesDialog, GuiPreferences)
showDialog(nwGUI.showProjectSettingsDialog, GuiProjectSettings)
showDialog(nwGUI.showNovelDetailsDialog, GuiNovelDetails)
showDialog(nwGUI.showBuildManuscriptDialog, GuiManuscript)
showDialog(nwGUI.showProjectWordListDialog, GuiWordList)
showDialog(nwGUI.showWritingStatsDialog, GuiWritingStats)
showDialog(nwGUI.showAboutNWDialog, GuiAbout)
showDialog(nwGUI.showDictionariesDialog, GuiDictionaries)
qtbot.wait(20)
nwGUI.closeMain()
# END Test testI18n_Localisation
# END Test testGuiI18n_Localisation