diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 253bd90e..894e5fba 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -187,18 +187,15 @@ QStringList GeneralSettingsPage::findQmFiles() QDir dir(translationPath); QStringList fileNames = dir.entryList(QStringList(translationPrefix + "_*.qm"), QDir::Files, QDir::Name); fileNames.replaceInStrings(QRegExp(translationPrefix + "_(.*)\\.qm"), "\\1"); + fileNames.removeOne("en@source"); return fileNames; } QString GeneralSettingsPage::languageName(const QString &qmFile) { - if (qmFile == DEFAULT_LANG_CODE) - return DEFAULT_LANG_NAME; - - QTranslator translator; - translator.load(translationPrefix + "_" + qmFile + ".qm", translationPath); - - return translator.translate("i18n", DEFAULT_LANG_NAME); + QTranslator qTranslator; + qTranslator.load(translationPrefix + "_" + qmFile + ".qm", translationPath); + return qTranslator.translate("i18n", DEFAULT_LANG_NAME); } void GeneralSettingsPage::deckPathButtonClicked() diff --git a/cockatrice/src/settingscache.h b/cockatrice/src/settingscache.h index 94279795..a12a1023 100644 --- a/cockatrice/src/settingscache.h +++ b/cockatrice/src/settingscache.h @@ -20,7 +20,6 @@ class ReleaseChannel; #define PIXMAPCACHE_SIZE_MIN 64 #define PIXMAPCACHE_SIZE_MAX 2047 -#define DEFAULT_LANG_CODE "en" #define DEFAULT_LANG_NAME "English" #define CLIENT_INFO_NOT_SET "notset" diff --git a/cockatrice/translations/cockatrice_en@source.ts b/cockatrice/translations/cockatrice_en@source.ts index ee1cc6b1..c3c0d46e 100644 --- a/cockatrice/translations/cockatrice_en@source.ts +++ b/cockatrice/translations/cockatrice_en@source.ts @@ -25,77 +25,77 @@ AppearanceSettingsPage - + Error - + Could not create themes directory at '%1'. - + Theme settings - + Current theme: - + Open themes folder - + Card rendering - + Display card names on cards having a picture - + Scale cards on mouse over - + Hand layout - + Display hand horizontally (wastes space) - + Enable left justification - + Table grid layout - + Invert vertical coordinate - + Minimum player count for multi-column layout: - + Maximum font size for information displayed on cards: @@ -530,131 +530,131 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorSettingsPage - - + + Update Spoilers - - + + Success - + Download URLs have been reset. - + Downloaded card pictures have been reset. - + Error - + One or more downloaded card pictures could not be cleared. - + Add URL - - + + URL: - - + + Edit URL - + Add New URL - + Remove URL - + Updating... - + Choose path - + URL Download Priority - + Spoilers - + Download Spoilers Automatically - + Spoiler Location: - + Last Change - + Spoilers download automatically on launch - + Press the button to manually update without relaunching - + Do not close settings until manual update is complete - + Download card pictures on the fly - + How to add a custom URL - + Delete Downloaded Images - + Reset Download URLs @@ -1705,12 +1705,12 @@ Your email will be used to verify your account. DlgSettings - + Unknown Error loading card database - + Your card database is invalid. Cockatrice may not function correctly with an invalid database @@ -1721,7 +1721,7 @@ Would you like to change your database location setting? - + Your card database version is too old. This can cause problems loading card information or images @@ -1732,7 +1732,7 @@ Would you like to change your database location setting? - + Your card database did not finish loading Please file a ticket at https://github.com/Cockatrice/Cockatrice/issues with your cards.xml attached @@ -1741,21 +1741,21 @@ Would you like to change your database location setting? - + File Error loading your card database. Would you like to change your database location setting? - + Your card database was loaded but contains no cards. Would you like to change your database location setting? - + Unknown card database load status Please file a ticket at https://github.com/Cockatrice/Cockatrice/issues @@ -1764,59 +1764,59 @@ Would you like to change your database location setting? - - - + + + Error - + The path to your deck directory is invalid. Would you like to go back and set the correct path? - + The path to your card pictures directory is invalid. Would you like to go back and set the correct path? - + Settings - + General - + Appearance - + User Interface - + Card Sources - + Chat - + Sound - + Shortcuts @@ -2251,87 +2251,87 @@ You may have to build from source yourself. - - - - - - + + + + + + Choose path - + Personal settings - + Language: - + Paths (editing disabled in portable mode) - + Paths - + Decks directory: - + Replays directory: - + Pictures directory: - + Card database: - + Custom database directory: - + Token database: - + Picture cache size: - + Update channel - + Notify if a feature supported by the server is missing in my client - + Automatically run Oracle when running a new version of Cockatrice - + Show tips on startup @@ -3679,105 +3679,105 @@ Cockatrice will now reload the card database. MessagesSettingsPage - + Word1 Word2 Word3 - + Add New Message - + Edit Message - + Remove Message - + Add message - - + + Message: - + Edit message - + Chat settings - + Custom alert words - + Enable chat mentions - + Enable mention completer - + In-game message macros - + Ignore chat room messages sent by unregistered users - + Ignore private messages sent by unregistered users - - + + Invert text color - + Enable desktop notifications for private messages - + Enable desktop notification for mentions - + Enable room message history on join - - + + (Color is hexadecimal) - + Separate words with a space, alphanumeric characters only @@ -4844,52 +4844,52 @@ Cockatrice will now reload the card database. ShortcutSettingsPage - + Restore all default shortcuts - + Do you really want to restore all default shortcuts? - + Clear all default shortcuts - + Do you really want to clear all shortcuts? - + Action - + Shortcut - + Section: - + Action: - + Shortcut: - + How to set custom shortcuts @@ -4930,27 +4930,27 @@ Please check your shortcut settings! SoundSettingsPage - + Enable &sounds - + Current sounds theme: - + Test system sound engine - + Sound settings - + Master volume @@ -6517,57 +6517,57 @@ Please refrain from engaging in this activity or further actions may be taken ag UserInterfaceSettingsPage - + General interface settings - + &Double-click cards to play them (instead of single-click) - + &Play all nonlands onto the stack (not the battlefield) by default - + Annotate card text on tokens - + Use tear-off menus, allowing right click menus to persist on screen - + Notifications settings - + Enable notifications in taskbar - + Notify in the taskbar for game events while you are spectating - + Notify in the taskbar when users in your buddy list connect - + Animation settings - + &Tap/untap animation @@ -6802,12 +6802,12 @@ Please refrain from engaging in this activity or further actions may be taken ag main - + Connect on startup - + Debug to file diff --git a/oracle/src/oraclewizard.cpp b/oracle/src/oraclewizard.cpp index 0da8ecaa..957546fd 100644 --- a/oracle/src/oraclewizard.cpp +++ b/oracle/src/oraclewizard.cpp @@ -54,6 +54,9 @@ OracleWizard::OracleWizard(QWidget *parent) : QWizard(parent) { + // define a dummy context that will be used where needed + QString dummy = QT_TRANSLATE_NOOP("i18n", "English"); + settings = new QSettings(SettingsCache::instance().getSettingsPath() + "global.ini", QSettings::IniFormat, this); connect(&SettingsCache::instance(), SIGNAL(langChanged()), this, SLOT(updateLanguage())); @@ -168,19 +171,15 @@ QStringList IntroPage::findQmFiles() QDir dir(translationPath); QStringList fileNames = dir.entryList(QStringList(translationPrefix + "_*.qm"), QDir::Files, QDir::Name); fileNames.replaceInStrings(QRegExp(translationPrefix + "_(.*)\\.qm"), "\\1"); + fileNames.removeOne("en@source"); return fileNames; } QString IntroPage::languageName(const QString &qmFile) { - if (qmFile == DEFAULT_LANG_CODE) { - return DEFAULT_LANG_NAME; - } - - QTranslator translator; - translator.load(translationPrefix + "_" + qmFile + ".qm", translationPath); - - return translator.translate("i18n", DEFAULT_LANG_NAME); + QTranslator qTranslator; + qTranslator.load(translationPrefix + "_" + qmFile + ".qm", translationPath); + return qTranslator.translate("i18n", DEFAULT_LANG_NAME); } void IntroPage::languageBoxChanged(int index) diff --git a/oracle/translations/oracle_en@source.ts b/oracle/translations/oracle_en@source.ts index bc27c69b..e36a54c5 100644 --- a/oracle/translations/oracle_en@source.ts +++ b/oracle/translations/oracle_en@source.ts @@ -4,22 +4,22 @@ IntroPage - + Introduction - + This wizard will import the list of sets, cards, and tokens that will be used by Cockatrice. - + Interface language: - + Version: @@ -27,127 +27,127 @@ LoadSetsPage - + Source selection - + Please specify a compatible source for the list of sets and cards. You can specify a URL address that will be downloaded or use an existing file from your computer. - + Download URL: - + Local file: - + Restore default URL - + Choose file... - + Load sets file - + Sets JSON file (%1) - - - - - - + + + + + + Error - + The provided URL is not valid. - + Downloading (0MB) - + Please choose a file. - + Cannot open file '%1'. - + Downloading (%1MB) - + Network error: %1. - + Parsing file - + Xz extraction failed. - + Sorry, this version of Oracle does not support xz compressed files. - + Failed to open Zip archive: %1. - + Zip extraction failed: the Zip archive doesn't contain exactly one file. - + Zip extraction failed: %1. - + Sorry, this version of Oracle does not support zipped files. - + Do you want to download the uncompressed file instead? - + The file was retrieved successfully, but it does not contain any sets data. @@ -155,42 +155,42 @@ LoadSpoilersPage - + Save spoiler database - + XML; spoiler database (*.xml) - + Spoilers import - + Please specify a compatible source for spoiler data. - + Download URL: - + Restore default URL - + The spoiler database will be saved at the following location: - + Save to a custom path (not recommended) @@ -198,42 +198,42 @@ LoadTokensPage - + Save token database - + XML; token database (*.xml) - + Tokens import - + Please specify a compatible source for token data. - + Download URL: - + Restore default URL - + The token database will be saved at the following location: - + Save to a custom path (not recommended) @@ -249,7 +249,7 @@ OracleWizard - + Oracle Importer @@ -257,22 +257,22 @@ OutroPage - + Finished - + The wizard has finished. - + You can now start using Cockatrice with the newly updated cards. - + If the card databases don't reload automatically, restart the Cockatrice client. @@ -280,68 +280,68 @@ SaveSetsPage - - + + Error - + No set has been imported. - + Sets imported - + The following sets have been found: - + Press "Save" to store the imported cards in the Cockatrice database. - + The card database will be saved at the following location: - + Save to a custom path (not recommended) - + &Save - + Import finished: %1 cards. - + %1: %2 cards imported - + Save card database - + XML; card database (*.xml) - + The file could not be saved to %1 @@ -381,6 +381,14 @@ + + i18n + + + English + + + main