mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 11:40:42 +00:00
Allow for translated html texts
This commit is contained in:
parent
b0ef042e40
commit
a57acf3211
@ -67,9 +67,24 @@ void AboutDialog::on_donateButton_clicked()
|
|||||||
}
|
}
|
||||||
******************************************************/
|
******************************************************/
|
||||||
|
|
||||||
|
QString AboutDialog::getFilename(QString name)
|
||||||
|
{
|
||||||
|
QString filename;
|
||||||
|
QString language = AppSetting->language();
|
||||||
|
if (language == "en_US") {
|
||||||
|
filename = ":docs/"+name+".html";
|
||||||
|
} else {
|
||||||
|
QString docRoot = appResourcePath() + "/Html/";
|
||||||
|
filename = docRoot + name + language + "/Html/";
|
||||||
|
}
|
||||||
|
qDebug() << "Looking for " + filename;
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
QString AboutDialog::getAbout()
|
QString AboutDialog::getAbout()
|
||||||
{
|
{
|
||||||
QFile clfile(":/docs/about.html");
|
QString aboutFile = getFilename("about");
|
||||||
|
QFile clfile(aboutFile);
|
||||||
QString text = tr("Sorry, could not locate About file.");
|
QString text = tr("Sorry, could not locate About file.");
|
||||||
if (clfile.open(QIODevice::ReadOnly)) {
|
if (clfile.open(QIODevice::ReadOnly)) {
|
||||||
text = clfile.readAll();
|
text = clfile.readAll();
|
||||||
@ -81,7 +96,8 @@ QString AboutDialog::getAbout()
|
|||||||
|
|
||||||
QString AboutDialog::getCredits()
|
QString AboutDialog::getCredits()
|
||||||
{
|
{
|
||||||
QFile clfile(":/docs/credits.html");
|
QString creditsFile = getFilename("credits");
|
||||||
|
QFile clfile(creditsFile);
|
||||||
QString text = tr("Sorry, could not locate Credits file.");
|
QString text = tr("Sorry, could not locate Credits file.");
|
||||||
if (clfile.open(QIODevice::ReadOnly)) {
|
if (clfile.open(QIODevice::ReadOnly)) {
|
||||||
text = clfile.readAll();
|
text = clfile.readAll();
|
||||||
@ -92,7 +108,8 @@ QString AboutDialog::getCredits()
|
|||||||
|
|
||||||
QString AboutDialog::getRelnotes()
|
QString AboutDialog::getRelnotes()
|
||||||
{
|
{
|
||||||
QFile clfile(":/docs/release_notes.html");
|
QString relNotesFile = getFilename("release_notes");
|
||||||
|
QFile clfile(relNotesFile);
|
||||||
QString changeLog = tr("Sorry, could not locate Release Notes.");
|
QString changeLog = tr("Sorry, could not locate Release Notes.");
|
||||||
if (clfile.open(QIODevice::ReadOnly)) {
|
if (clfile.open(QIODevice::ReadOnly)) {
|
||||||
//Todo, write XML parser and only show the latest..
|
//Todo, write XML parser and only show the latest..
|
||||||
|
@ -27,6 +27,7 @@ private slots:
|
|||||||
void on_donateButton_clicked();
|
void on_donateButton_clicked();
|
||||||
***************************************************/
|
***************************************************/
|
||||||
private:
|
private:
|
||||||
|
QString getFilename(QString name);
|
||||||
QString getAbout();
|
QString getAbout();
|
||||||
QString getCredits();
|
QString getCredits();
|
||||||
QString getLicense();
|
QString getLicense();
|
||||||
|
@ -1076,7 +1076,7 @@ QString MainWindow::getWelcomeHTML()
|
|||||||
// +
|
// +
|
||||||
"<p><h3>" + tr("Further Information") + "</h3></p>"
|
"<p><h3>" + tr("Further Information") + "</h3></p>"
|
||||||
"<p>" +
|
"<p>" +
|
||||||
tr("Here are the <a href='qrc:/docs/release_notes.html'>release notes</a> for this version.") +
|
tr("The release notes for this version can be found in the About OSCAR menu item.") +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
tr("Plus a few <a href='qrc:/docs/usage.html'>usage notes</a>, and some important information for Mac users.")
|
tr("Plus a few <a href='qrc:/docs/usage.html'>usage notes</a>, and some important information for Mac users.")
|
||||||
+ "<br/>" +
|
+ "<br/>" +
|
||||||
|
Loading…
Reference in New Issue
Block a user