Merge branch 'dev' into manuscript_stats
This commit is contained in:
+1515
-1638
File diff suppressed because it is too large
Load Diff
+1658
-1781
File diff suppressed because it is too large
Load Diff
+1658
-1781
File diff suppressed because it is too large
Load Diff
+1657
-1780
File diff suppressed because it is too large
Load Diff
+1657
-1780
File diff suppressed because it is too large
Load Diff
+2198
-2139
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,18 @@
|
|||||||
{
|
{
|
||||||
"Synopsis": "Synopsis",
|
"Synopsis": "Synopsis",
|
||||||
|
"Short Description": "Korte beschrijving",
|
||||||
"Comment": "Opmerking",
|
"Comment": "Opmerking",
|
||||||
"Notes": "Notities",
|
"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",
|
"0": "nul",
|
||||||
"1": "één",
|
"1": "één",
|
||||||
"2": "twee",
|
"2": "twee",
|
||||||
|
|||||||
@@ -1,7 +1,18 @@
|
|||||||
{
|
{
|
||||||
"Synopsis": "Sinopse",
|
"Synopsis": "Sinopse",
|
||||||
|
"Short Description": "Descrição breve",
|
||||||
"Comment": "Comentários",
|
"Comment": "Comentários",
|
||||||
"Notes": "Notas",
|
"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",
|
"0": "Zero",
|
||||||
"1": "Um",
|
"1": "Um",
|
||||||
"2": "Dois",
|
"2": "Dois",
|
||||||
|
|||||||
@@ -68,9 +68,9 @@ class GuiAbout(QDialog):
|
|||||||
|
|
||||||
self.nwInfo = VersionInfoWidget(self)
|
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>"
|
"<a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPL v3.0</a>"
|
||||||
)))
|
))
|
||||||
self.nwLicence.setOpenExternalLinks(True)
|
self.nwLicence.setOpenExternalLinks(True)
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
|
|||||||
@@ -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("Editing Time")), self.projEditTime)
|
||||||
self.projForm.addRow("<b>{0}</b>".format(self.tr("Word Count")), self.projWords)
|
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 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.setContentsMargins(mPx, 0, 0, 0)
|
||||||
self.projForm.setHorizontalSpacing(hPx)
|
self.projForm.setHorizontalSpacing(hPx)
|
||||||
self.projForm.setVerticalSpacing(vPx)
|
self.projForm.setVerticalSpacing(vPx)
|
||||||
|
|||||||
@@ -23,30 +23,63 @@ from __future__ import annotations
|
|||||||
import sys
|
import sys
|
||||||
import pytest
|
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)
|
LANG_DATA = CONFIG.listLanguages(CONFIG.LANG_NW)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@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.skipif(not LANG_DATA, reason="No i18n Data")
|
||||||
@pytest.mark.parametrize("language", [a for a, b in LANG_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."""
|
"""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, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(QMessageBox, "result", lambda *a: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "result", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Set the test langauge
|
# Set the test language
|
||||||
CONFIG.guiLocale = language
|
CONFIG.guiLocale = language
|
||||||
CONFIG.initLocalisation(qApp)
|
CONFIG.initLocalisation(qApp)
|
||||||
|
|
||||||
nwGUI = main(["--testmode", f"--config={fncPath}", f"--data={fncPath}"])
|
buildTestProject(nwGUI, projPath)
|
||||||
qtbot.addWidget(nwGUI)
|
|
||||||
nwGUI.show()
|
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)
|
qtbot.wait(20)
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
|
|
||||||
# END Test testI18n_Localisation
|
# END Test testGuiI18n_Localisation
|
||||||
|
|||||||
Reference in New Issue
Block a user