Skip to content

Commit

Permalink
translations: Stub Japanese support for @tos1. Change Español -> Cast…
Browse files Browse the repository at this point in the history
…ellano in the language list, more Spanish translation improvements.
  • Loading branch information
Swyter committed May 15, 2024
1 parent 9533176 commit 848f673
Show file tree
Hide file tree
Showing 13 changed files with 5,868 additions and 605 deletions.
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ int main(int argc, char* argv[])
case 2: loc = QString("zh_CN");break;
case 3: loc = QString("es");break;
case 4: loc = QString("de");break;
case 5: loc = QString("ja");break;
}
translator.load(QString(":/translations/openbrf_%1.qm").arg(loc));

Expand Down
6 changes: 4 additions & 2 deletions main_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,18 @@ void MainWindow::createMenus()
lang -> addAction( optionLanguage[1] = new QAction("English",this) );
lang -> addAction( optionLanguage[2] = new QAction(QString::fromUtf8("中文(简体)"),this ) );
lang -> addAction( optionLanguage[4] = new QAction("Deutsche",this) );
lang -> addAction( optionLanguage[3] = new QAction(QString::fromUtf8("Español"),this) );
lang -> addAction( optionLanguage[3] = new QAction(QString::fromUtf8("Castellano"),this) );
lang -> addAction( optionLanguage[5] = new QAction(QString::fromUtf8("日本語"),this) );
lang -> addSeparator();
lang -> addAction( optionLanguageCustom = new QAction(tr("Test a custom translation file..."),this) );

for (int i=0; i<4; i++) optionLanguage[i]->setCheckable(true);
for (int i=0; i<6; i++) optionLanguage[i]->setCheckable(true);
connect(optionLanguage[0],SIGNAL(triggered()), this, SLOT(optionLanguageSet0()));
connect(optionLanguage[1],SIGNAL(triggered()), this, SLOT(optionLanguageSet1()));
connect(optionLanguage[2],SIGNAL(triggered()), this, SLOT(optionLanguageSet2()));
connect(optionLanguage[3],SIGNAL(triggered()), this, SLOT(optionLanguageSet3()));
connect(optionLanguage[4],SIGNAL(triggered()), this, SLOT(optionLanguageSet4()));
connect(optionLanguage[5],SIGNAL(triggered()), this, SLOT(optionLanguageSet5()));
connect(optionLanguageCustom,SIGNAL(triggered()), this, SLOT(optionLanguageSetCustom()));


Expand Down
3 changes: 2 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4000,6 +4000,7 @@ void MainWindow::optionLanguageSet1(){setLanguage(1);}
void MainWindow::optionLanguageSet2(){setLanguage(2);}
void MainWindow::optionLanguageSet3(){setLanguage(3);}
void MainWindow::optionLanguageSet4(){setLanguage(4);}
void MainWindow::optionLanguageSet5(){setLanguage(5);}

void MainWindow::optionLanguageSetCustom(){
if (maybeSave()) {
Expand All @@ -4026,7 +4027,7 @@ void MainWindow::setLanguage(int k){

//QMessageBox::information(this,"OpenBrf",tr("Language changed:\nRerun OpenBrf for changes to take place"));
}
for (int i=0; i<4; i++) optionLanguage[i]->setChecked(i==k);
for (int i=0; i<6; i++) optionLanguage[i]->setChecked(i==k);
curLanguage = k;

}
Expand Down
3 changes: 2 additions & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private slots:
void optionLanguageSet2();
void optionLanguageSet3();
void optionLanguageSet4();
void optionLanguageSet5();
void optionLanguageSetCustom();
void optionSetBgColor();
void optionLodSettings();
Expand Down Expand Up @@ -550,7 +551,7 @@ public slots:
QAction *optionAutoFixTextureInfo; // unused
QAction *optionAutoZoomUseGlobal;
QAction *optionAutoZoomUseSelected;
QAction *optionLanguage[6];
QAction *optionLanguage[7];
QAction *optionLanguageCustom;
QAction *optionInferMaterialOn;
QAction *optionInferMaterialOff;
Expand Down
1 change: 1 addition & 0 deletions openBrf.pro
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ TRANSLATIONS += translations/openbrf_zh.ts
TRANSLATIONS += translations/openbrf_en.ts
TRANSLATIONS += translations/openbrf_es.ts
TRANSLATIONS += translations/openbrf_de.ts
TRANSLATIONS += translations/openbrf_ja.ts
RC_FILE = openBrf.rc
win32 {
DEFINES += NOMINMAX
Expand Down
1 change: 1 addition & 0 deletions resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<file>icons/ico_mid.png</file>
<file>icons/ico_right.png</file>
<file>translations/openbrf_es.qm</file>
<file>translations/openbrf_ja.qm</file>
<file>carry_positions.txt</file>
</qresource>
</RCC>
Loading

1 comment on commit 848f673

@Swyter
Copy link
Owner Author

@Swyter Swyter commented on 848f673 May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imagen

Please sign in to comment.