Merge branch 'master' of github.com:lordmulder/LameXP
This commit is contained in:
commit
06889ec7a9
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2351
etc/Translation/LameXP_TW.ts
Normal file
2351
etc/Translation/LameXP_TW.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -111,10 +111,6 @@
|
||||
<source>Released under the terms of the GNU General Public License.</source>
|
||||
<translation>以下发布的GNU通用公共许可证的条款。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.</source>
|
||||
<translation>LameXP作为一个整体的版权归LoRd_MuldeR。在LameXP使用第三方软件著作权属于作者本人。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LameXP - Audio Encoder Front-end</source>
|
||||
<translation>LameXP - 前端音频编码器</translation>
|
||||
@ -227,6 +223,10 @@
|
||||
<source>avs2wav - Avisynth to Wave Audio converter</source>
|
||||
<translation>avs2wav - Avisynth到WAV音频转换器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AudioFileModel</name>
|
||||
|
@ -9,6 +9,7 @@
|
||||
<file>flags/kr.png</file>
|
||||
<file>flags/pl.png</file>
|
||||
<file>flags/ru.png</file>
|
||||
<file>flags/tw.png</file>
|
||||
<file>flags/uk.png</file>
|
||||
<file>flags/zh.png</file>
|
||||
</qresource>
|
||||
|
@ -15,6 +15,8 @@
|
||||
<file>localization/LameXP_PL.qm.txt</file>
|
||||
<file>localization/LameXP_RU.qm</file>
|
||||
<file>localization/LameXP_RU.qm.txt</file>
|
||||
<file>localization/LameXP_TW.qm</file>
|
||||
<file>localization/LameXP_TW.qm.txt</file>
|
||||
<file>localization/LameXP_UK.qm</file>
|
||||
<file>localization/LameXP_UK.qm.txt</file>
|
||||
<file>localization/LameXP_ZH.qm</file>
|
||||
|
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 472 B |
@ -1 +1 @@
|
||||
42,Deutsch
|
||||
42,0,Deutsch
|
@ -1 +1 @@
|
||||
111,Español
|
||||
111,0,Español
|
@ -1 +1 @@
|
||||
37,Française
|
||||
37,0,Française
|
@ -1 +1 @@
|
||||
58,Italiano
|
||||
58,0,Italiano
|
@ -1 +1 @@
|
||||
66,한국어
|
||||
66,0,한국어
|
@ -1 +1 @@
|
||||
90,Polski
|
||||
90,0,Polski
|
@ -1 +1 @@
|
||||
96,Русский
|
||||
96,0,Русский
|
BIN
res/localization/LameXP_TW.qm
Normal file
BIN
res/localization/LameXP_TW.qm
Normal file
Binary file not shown.
1
res/localization/LameXP_TW.qm.txt
Normal file
1
res/localization/LameXP_TW.qm.txt
Normal file
@ -0,0 +1 @@
|
||||
25,208,繁体中文
|
@ -1 +1 @@
|
||||
129,Українська
|
||||
129,0,Українська
|
Binary file not shown.
@ -1 +1 @@
|
||||
25,简体中文
|
||||
25,44,简体中文
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 4
|
||||
#define VER_LAMEXP_TYPE Alpha
|
||||
#define VER_LAMEXP_PATCH 10
|
||||
#define VER_LAMEXP_BUILD 818
|
||||
#define VER_LAMEXP_BUILD 820
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Tool versions (minimum expected versions!)
|
||||
|
@ -67,8 +67,9 @@ g_lamexp_contributors[] =
|
||||
{"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
|
||||
{"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
|
||||
{"", L"", L"Иван Митин", "bardak@inbox.ru" },
|
||||
{"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
|
||||
{"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
|
||||
{"zh", L"普通话", L"456Vv", "123@456vv.com" },
|
||||
{"zh", L"简体中文", L"456Vv", "123@456vv.com" },
|
||||
{NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -186,6 +186,7 @@ static struct
|
||||
QMap<QString, QString> files;
|
||||
QMap<QString, QString> names;
|
||||
QMap<QString, unsigned int> sysid;
|
||||
QMap<QString, unsigned int> cntry;
|
||||
}
|
||||
g_lamexp_translation;
|
||||
|
||||
@ -1251,7 +1252,7 @@ const QString lamexp_version2string(const QString &pattern, unsigned int version
|
||||
/*
|
||||
* Register a new translation
|
||||
*/
|
||||
bool lamexp_translation_register(const QString &langId, const QString &qmFile, const QString &langName, unsigned int &systemId)
|
||||
bool lamexp_translation_register(const QString &langId, const QString &qmFile, const QString &langName, unsigned int &systemId, unsigned int &country)
|
||||
{
|
||||
if(qmFile.isEmpty() || langName.isEmpty() || systemId < 1)
|
||||
{
|
||||
@ -1261,6 +1262,7 @@ bool lamexp_translation_register(const QString &langId, const QString &qmFile, c
|
||||
g_lamexp_translation.files.insert(langId, qmFile);
|
||||
g_lamexp_translation.names.insert(langId, langName);
|
||||
g_lamexp_translation.sysid.insert(langId, systemId);
|
||||
g_lamexp_translation.cntry.insert(langId, country);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1289,6 +1291,14 @@ unsigned int lamexp_translation_sysid(const QString &langId)
|
||||
return g_lamexp_translation.sysid.value(langId.toLower(), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get translation script id
|
||||
*/
|
||||
unsigned int lamexp_translation_country(const QString &langId)
|
||||
{
|
||||
return g_lamexp_translation.cntry.value(langId.toLower(), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Install a new translator
|
||||
*/
|
||||
|
@ -111,9 +111,10 @@ bool lamexp_is_hibernation_supported(void);
|
||||
|
||||
//Translation support
|
||||
QStringList lamexp_query_translations(void);
|
||||
bool lamexp_translation_register(const QString &langId, const QString &qmFile, const QString &langName, unsigned int &systemId);
|
||||
bool lamexp_translation_register(const QString &langId, const QString &qmFile, const QString &langName, unsigned int &systemId, unsigned int &country);
|
||||
QString lamexp_translation_name(const QString &language);
|
||||
unsigned int lamexp_translation_sysid(const QString &langId);
|
||||
unsigned int lamexp_translation_country(const QString &langId);
|
||||
bool lamexp_install_translator_from_file(const QString &qmFile);
|
||||
bool lamexp_install_translator(const QString &language);
|
||||
QStringList lamexp_available_codepages(bool noAliases = true);
|
||||
|
@ -271,17 +271,38 @@ QString SettingsModel::defaultLanguage(void)
|
||||
return *m_defaultLanguage;
|
||||
}
|
||||
|
||||
//Check if we can use the default translation
|
||||
//Detect system langauge
|
||||
QLocale systemLanguage= QLocale::system();
|
||||
if(systemLanguage.language() == QLocale::English || systemLanguage.language() == QLocale::C)
|
||||
qDebug("[Locale]");
|
||||
qDebug("Language: %s (%d)", QLocale::languageToString(systemLanguage.language()).toUtf8().constData(), systemLanguage.language());
|
||||
qDebug("Country is: %s (%d)", QLocale::countryToString(systemLanguage.country()).toUtf8().constData(), systemLanguage.country());
|
||||
qDebug("Script is: %s (%d)\n", QLocale::scriptToString(systemLanguage.script()).toUtf8().constData(), systemLanguage.script());
|
||||
|
||||
//Check if we can use the default translation
|
||||
if(systemLanguage.language() == QLocale::English /*|| systemLanguage.language() == QLocale::C*/)
|
||||
{
|
||||
m_defaultLanguage = new QString(LAMEXP_DEFAULT_LANGID);
|
||||
return LAMEXP_DEFAULT_LANGID;
|
||||
}
|
||||
|
||||
//Try to find a suitable translation for the user's system language
|
||||
//Try to find a suitable translation for the user's system language *and* country
|
||||
QStringList languages = lamexp_query_translations();
|
||||
while(!languages.isEmpty())
|
||||
{
|
||||
QString currentLangId = languages.takeFirst();
|
||||
if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
|
||||
{
|
||||
if(lamexp_translation_country(currentLangId) == systemLanguage.country())
|
||||
{
|
||||
m_defaultLanguage = new QString(currentLangId);
|
||||
return currentLangId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Try to find a suitable translation for the user's system language
|
||||
languages = lamexp_query_translations();
|
||||
while(!languages.isEmpty())
|
||||
{
|
||||
QString currentLangId = languages.takeFirst();
|
||||
if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
|
||||
|
@ -246,8 +246,8 @@ void InitializationThread::initTranslations(void)
|
||||
while(!qmFiles.isEmpty())
|
||||
{
|
||||
QString langId, langName;
|
||||
unsigned int systemId = 0, country = 0;
|
||||
QString qmFile = qmFiles.takeFirst();
|
||||
unsigned int systemId = 0;
|
||||
|
||||
QRegExp langIdExp("LameXP_(\\w\\w)\\.qm", Qt::CaseInsensitive);
|
||||
if(langIdExp.indexIn(qmFile) >= 0)
|
||||
@ -262,10 +262,11 @@ void InitializationThread::initTranslations(void)
|
||||
while(!stream.atEnd())
|
||||
{
|
||||
QStringList langInfo = stream.readLine().simplified().split(",", QString::SkipEmptyParts);
|
||||
if(langInfo.count() == 2)
|
||||
if(langInfo.count() == 3)
|
||||
{
|
||||
systemId = langInfo.at(0).trimmed().toUInt();
|
||||
langName = langInfo.at(1).trimmed();
|
||||
country = langInfo.at(1).trimmed().toUInt();
|
||||
langName = langInfo.at(2).trimmed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -274,9 +275,9 @@ void InitializationThread::initTranslations(void)
|
||||
|
||||
if(!(langId.isEmpty() || langName.isEmpty() || systemId == 0))
|
||||
{
|
||||
if(lamexp_translation_register(langId, qmFile, langName, systemId))
|
||||
if(lamexp_translation_register(langId, qmFile, langName, systemId, country))
|
||||
{
|
||||
qDebug("Registering translation: %s = %s (%u)", qmFile.toUtf8().constData(), langName.toUtf8().constData(), systemId);
|
||||
qDebug("Registering translation: %s = %s (%u) [%u]", qmFile.toUtf8().constData(), langName.toUtf8().constData(), systemId, country);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user