Add a translations credit section to the About dialog

This commit is contained in:
Veronica K. B. Olsen
2021-03-03 21:52:30 +01:00
parent dd10486f27
commit 26c49e7c22
2 changed files with 39 additions and 26 deletions
+2 -2
View File
@@ -74,8 +74,8 @@ __helpurl__ = "https://github.com/vkbo/novelWriter/discussions"
__releaseurl__ = "https://github.com/vkbo/novelWriter/releases/latest" __releaseurl__ = "https://github.com/vkbo/novelWriter/releases/latest"
__docurl__ = "https://novelwriter.readthedocs.io" __docurl__ = "https://novelwriter.readthedocs.io"
__credits__ = [ __credits__ = [
"Veronica Berglyd Olsen (developer)", "Veronica Berglyd Olsen (author, maintainer)",
"Marian Lückhof (contributor, tester)" "Marian Lückhof (concept, testing)"
] ]
## ##
+37 -24
View File
@@ -135,8 +135,8 @@ class GuiAbout(QDialog):
webLink = f"<a href='{nw.__url__:s}'>{nw.__domain__:s}</a>" webLink = f"<a href='{nw.__url__:s}'>{nw.__domain__:s}</a>"
aboutMsg = ( aboutMsg = (
"<h2>{title1}</h2>" "<h2>{title1}</h2>"
"<p>{copyright}.</p>" "<p>{copy}</p>"
"<p>{website}</p>" "<p>{link}</p>"
"<p>{intro}</p>" "<p>{intro}</p>"
"<p>{license1}</p>" "<p>{license1}</p>"
"<p>{license2}</p>" "<p>{license2}</p>"
@@ -144,27 +144,27 @@ class GuiAbout(QDialog):
"<h3>{title2}</h3>" "<h3>{title2}</h3>"
"<p>{credits}</p>" "<p>{credits}</p>"
).format( ).format(
title1 = self.tr("About novelWriter"), title1 = self.tr("About novelWriter"),
copyright = nw.__copyright__, copy = nw.__copyright__,
website = self.tr("Website: {0}").format(webLink), link = self.tr("Website: {0}").format(webLink),
title2 = self.tr("Credits"), title2 = self.tr("Credits"),
credits = "<br/>".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]), credits = "<br/>".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]),
intro = self.tr( intro = self.tr(
"novelWriter is a markdown-like text editor designed for organising and " "novelWriter is a markdown-like text editor designed for organising and "
"writing novels. It is written in Python 3 with a Qt5 GUI, using PyQt5." "writing novels. It is written in Python 3 with a Qt5 GUI, using PyQt5."
), ),
license1 = self.tr( license1 = self.tr(
"novelWriter is free software: you can redistribute it and/or modify it " "novelWriter is free software: you can redistribute it and/or modify it "
"under the terms of the GNU General Public License as published by the " "under the terms of the GNU General Public License as published by the "
"Free Software Foundation, either version 3 of the License, or (at your " "Free Software Foundation, either version 3 of the License, or (at your "
"option) any later version." "option) any later version."
), ),
license2 = self.tr( license2 = self.tr(
"novelWriter is distributed in the hope that it will be useful, but " "novelWriter is distributed in the hope that it will be useful, but "
"WITHOUT ANY WARRANTY; without even the implied warranty of " "WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
), ),
license3 = self.tr( license3 = self.tr(
"See the Licence tab for the full licence text, or visit the " "See the Licence tab for the full licence text, or visit the "
"GNU website at {0} for more details." "GNU website at {0} for more details."
).format( ).format(
@@ -172,34 +172,47 @@ class GuiAbout(QDialog):
), ),
) )
trOrder = self.tr("{0}{1}: {2}")
i18n = [
("American English", "Veronica Berglyd Olsen"),
("British English", "Veronica Berglyd Olsen"),
("Français", "Jan Lüdke (jyhelle)"),
("Norsk Bokmål", "Veronica Berglyd Olsen"),
("Português", "Bruno Meneguello"),
]
aboutMsg += "<h4>%s</h4><p>%s</p>" % (
self.tr("Translations"),
"<br/>".join([trOrder.format(listPrefix, n, c) for n, c in i18n]),
)
theTheme = self.theParent.theTheme theTheme = self.theParent.theTheme
theIcons = self.theParent.theTheme.theIcons theIcons = self.theParent.theTheme.theIcons
if theTheme.themeName: if theTheme.themeName and theTheme.themeAuthor != "N/A":
aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % ( aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % (
self.tr("Theme: {0}").format(theTheme.themeName), self.tr("<b>Theme:</b> {0}").format(theTheme.themeName),
self.tr("Author: {0}").format(theTheme.themeAuthor), self.tr("<b>Author:</b> {0}").format(theTheme.themeAuthor),
self.tr("Credit: {0}").format(theTheme.themeCredit), self.tr("<b>Credit:</b> {0}").format(theTheme.themeCredit),
self.tr("Licence: {0}").format( self.tr("<b>Licence:</b> {0}").format(
f"<a href='{theTheme.themeLicenseUrl}'>{theTheme.themeLicense}</a>" f"<a href='{theTheme.themeLicenseUrl}'>{theTheme.themeLicense}</a>"
) )
) )
if theIcons.themeName: if theIcons.themeName:
aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % ( aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % (
self.tr("Icons: {0}").format(theIcons.themeName), self.tr("<b>Icons:</b> {0}").format(theIcons.themeName),
self.tr("Author: {0}").format(theIcons.themeAuthor), self.tr("<b>Author:</b> {0}").format(theIcons.themeAuthor),
self.tr("Credit: {0}").format(theIcons.themeCredit), self.tr("<b>Credit:</b> {0}").format(theIcons.themeCredit),
self.tr("Licence: {0}").format( self.tr("<b>Licence:</b> {0}").format(
f"<a href='{theIcons.themeLicenseUrl}'>{theIcons.themeLicense}</a>" f"<a href='{theIcons.themeLicenseUrl}'>{theIcons.themeLicense}</a>"
) )
) )
if theTheme.syntaxName: if theTheme.syntaxName:
aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % ( aboutMsg += "<h4>%s</h4><p>%s<br/>%s<br/>%s</p>" % (
self.tr("Syntax: {0}").format(theTheme.syntaxName), self.tr("<b>Syntax:</b> {0}").format(theTheme.syntaxName),
self.tr("Author: {0}").format(theTheme.syntaxAuthor), self.tr("<b>Author:</b> {0}").format(theTheme.syntaxAuthor),
self.tr("Credit: {0}").format(theTheme.syntaxCredit), self.tr("<b>Credit:</b> {0}").format(theTheme.syntaxCredit),
self.tr("Licence: {0}").format( self.tr("<b>Licence:</b> {0}").format(
f"<a href='{theTheme.syntaxLicenseUrl}'>{theTheme.syntaxLicense}</a>" f"<a href='{theTheme.syntaxLicenseUrl}'>{theTheme.syntaxLicense}</a>"
) )
) )