-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add preferences dialog and app language option
- Loading branch information
1 parent
c5f70e6
commit 09b7c82
Showing
35 changed files
with
1,322 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef MEOW_APP_LANGUAGE_H | ||
#define MEOW_APP_LANGUAGE_H | ||
|
||
#include <QString> | ||
#include <QVector> | ||
#include <QObject> | ||
|
||
namespace meow { | ||
|
||
using LanguageCode = QString; | ||
|
||
struct Language | ||
{ | ||
LanguageCode code; | ||
QString name; | ||
QString nameTranslated; | ||
}; | ||
|
||
static inline LanguageCode defaultLanguage() | ||
{ | ||
return "en"; | ||
} | ||
|
||
static inline QVector<Language> allLanguages() | ||
{ | ||
static QVector<Language> langs = { | ||
{"bg", "Bulgarian", QObject::tr("Bulgarian")}, | ||
{"zh", "Chinese", QObject::tr("Chinese")}, | ||
{"cs", "Czech", QObject::tr("Czech")}, | ||
{"en", "English", QObject::tr("English")}, | ||
{"fr", "French", QObject::tr("French")}, | ||
{"de", "German", QObject::tr("German")}, | ||
{"hu", "Hungarian", QObject::tr("Hungarian")}, | ||
{"it", "Italian", QObject::tr("Italian")}, | ||
{"ko", "Korean", QObject::tr("Korean")}, | ||
{"pt", "Portuguese", QObject::tr("Portuguese")}, | ||
{"ro", "Romanian", QObject::tr("Romanian")}, | ||
{"ru", "Russian", QObject::tr("Russian")}, | ||
{"es", "Spanish", QObject::tr("Spanish")}, | ||
{"sv", "Swedish", QObject::tr("Swedish")}, | ||
}; | ||
|
||
return langs; | ||
} | ||
|
||
} // namespace meow | ||
|
||
#endif // MEOW_APP_LANGUAGE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.