Skip to content

Commit

Permalink
Update of translations
Browse files Browse the repository at this point in the history
* Updated language display in preferences dialog to be more explicit
* Updated translations strings
  • Loading branch information
fabrejc committed Apr 21, 2017
1 parent e61c01b commit 280b267
Show file tree
Hide file tree
Showing 6 changed files with 590 additions and 389 deletions.
911 changes: 541 additions & 370 deletions resources/translations/openfluid-fr_FR.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,19 @@ Quitter l&apos;import quand même?</translation>
</message>
<message>
<location filename="SourceAddDialog.cpp" line="189"/>
<location filename="SourceAddDialog.cpp" line="282"/>
<location filename="SourceAddDialog.cpp" line="291"/>
<location filename="SourceAddDialog.cpp" line="283"/>
<location filename="SourceAddDialog.cpp" line="292"/>
<source>Aborting.</source>
<translation>Abandon.</translation>
</message>
<message>
<location filename="SourceAddDialog.cpp" line="279"/>
<location filename="SourceAddDialog.cpp" line="289"/>
<location filename="SourceAddDialog.cpp" line="280"/>
<location filename="SourceAddDialog.cpp" line="290"/>
<source>Error importing from source</source>
<translation>Erreur d&apos;&apos;import depuis la source</translation>
</message>
<message>
<location filename="SourceAddDialog.cpp" line="281"/>
<location filename="SourceAddDialog.cpp" line="282"/>
<source>The mandatory field &quot;OFLD_ID&quot; cannot be found.</source>
<translation>Le champ obligatoire &quot;OFLD_ID&quot; ne peut être trouvé.</translation>
</message>
Expand All @@ -540,8 +540,8 @@ Abandon.</translation>
<translation>%1 couche(s) disponible(s)</translation>
</message>
<message>
<location filename="SourceAddDialog.cpp" line="278"/>
<location filename="SourceAddDialog.cpp" line="288"/>
<location filename="SourceAddDialog.cpp" line="279"/>
<location filename="SourceAddDialog.cpp" line="289"/>
<source>Import error</source>
<translation>Erreur d&apos;import</translation>
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<context>
<name>GraphvizViewExtension</name>
<message>
<location filename="GraphvizViewExtension.cpp" line="100"/>
<location filename="GraphvizViewExtension.cpp" line="107"/>
<source>GraphViz software (dot) cannot be found!
Please make sure the dot program is accessible in the PATH
and try launching this extension again.</source>
Expand Down Expand Up @@ -102,7 +102,7 @@ et essayez de lancer cette extension à nouveau.</translation>
<context>
<name>signature</name>
<message>
<location filename="GraphvizViewExtension.cpp" line="59"/>
<location filename="GraphvizViewExtension.cpp" line="60"/>
<source>Spatial graph viewer (GraphViz)</source>
<translation>Visualisateur du graphe d&apos;espace (GraphViz)</translation>
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
<translation></translation>
</message>
<message>
<location filename="CSVObsParamsWidget.cpp" line="459"/>
<location filename="CSVObsParamsWidget.cpp" line="460"/>
<source>Automatic generation</source>
<translation>Génération automatique</translation>
</message>
<message>
<location filename="CSVObsParamsWidget.cpp" line="460"/>
<location filename="CSVObsParamsWidget.cpp" line="461"/>
<source>A format and one or more sets configurations will be automatically generated.
This will remove existing formats and sets.

Expand Down
42 changes: 35 additions & 7 deletions src/openfluid/ui/common/PreferencesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*/


#include <QLocale>
#include <QFileDialog>
#include <QMessageBox>
#include <QColorDialog>
Expand Down Expand Up @@ -127,7 +128,7 @@ PreferencesDialog::PreferencesDialog(QWidget* Parent, DisplayMode Mode):

initialize();

connect(ui->LangComboBox,SIGNAL(currentIndexChanged(const QString&)),this,SLOT(updateLanguage(const QString&)));
connect(ui->LangComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(updateLanguage(int)));
connect(ui->RecentMaxSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRecentsMax(int)));
connect(ui->ClearRecentsButton,SIGNAL(clicked()),this,SLOT(clearRecentsList()));
connect(ui->AutoSaveCheckBox,SIGNAL(toggled(bool)),this,SLOT(enableAutoSaveBeforeRun(bool)));
Expand Down Expand Up @@ -208,15 +209,40 @@ PreferencesDialog::~PreferencesDialog()
// =====================================================================


QString PreferencesDialog::getLanguageAsPrettyString(const QString& LangCode)
{
QLocale Loc(LangCode);
QString LangName;

if (Loc.language() == QLocale::English)
LangName = QLocale::languageToString(Loc.language());
else
LangName = Loc.nativeLanguageName();

LangName[0] = LangName[0].toUpper();
QString CountryName = Loc.nativeCountryName();

return QString("%1 (%2)").arg(LangName).arg(Loc.nativeCountryName());
}


// =====================================================================
// =====================================================================


void PreferencesDialog::initialize()
{
openfluid::base::PreferencesManager* PrefsMan = openfluid::base::PreferencesManager::instance();

// Interface
// TODO set up a fancier languages list
ui->LangComboBox->addItem("default");
ui->LangComboBox->addItems(openfluid::base::PreferencesManager::getAvailableLangs());
ui->LangComboBox->setCurrentIndex(ui->LangComboBox->findText(PrefsMan->getLang()));
// Interface language
QStringList AvailLangCodes = openfluid::base::PreferencesManager::getAvailableLangs();

ui->LangComboBox->addItem(getLanguageAsPrettyString("en_GB"),"default");
for (auto Code : AvailLangCodes)
{
ui->LangComboBox->addItem(getLanguageAsPrettyString(Code),Code);
}
ui->LangComboBox->setCurrentIndex(ui->LangComboBox->findData(PrefsMan->getLang()));

m_OriginalLangIndex = ui->LangComboBox->currentIndex();

Expand Down Expand Up @@ -298,8 +324,10 @@ void PreferencesDialog::changePage(QTreeWidgetItem* Current, QTreeWidgetItem* Pr
// =====================================================================


void PreferencesDialog::updateLanguage(const QString& Lang)
void PreferencesDialog::updateLanguage(int Index)
{
QString Lang = ui->LangComboBox->itemData(Index).toString();

openfluid::base::PreferencesManager::instance()->setLang(Lang);

updateRestartStatus();
Expand Down
4 changes: 3 additions & 1 deletion src/openfluid/ui/common/PreferencesDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class OPENFLUID_API PreferencesDialog : public OpenFLUIDDialog

void changePage(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);

void updateLanguage(const QString& Lang);
void updateLanguage(int Index);

void clearRecentsList();

Expand Down Expand Up @@ -197,6 +197,8 @@ class OPENFLUID_API PreferencesDialog : public OpenFLUIDDialog

void updateRestartStatus();

static QString getLanguageAsPrettyString(const QString& LangCode);


signals:

Expand Down

0 comments on commit 280b267

Please sign in to comment.