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)"
] ]
## ##
+30 -17
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>"
@@ -145,8 +145,8 @@ class GuiAbout(QDialog):
"<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(
@@ -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>"
) )
) )