Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
e2078bd6
Commit
e2078bd6
authored
Jan 11, 2010
by
Hugo Beauzee-Luyssen
Browse files
Only load translation that has been build.
parent
8aebc6fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Gui/LanguagePreferences.cpp
View file @
e2078bd6
...
...
@@ -35,7 +35,7 @@ LanguagePreferences::LanguagePreferences( QWidget *parent )
{
m_ui
.
setupUi
(
this
);
QDir
dir
(
"ts/"
,
"*.
ts
"
,
QDir
::
Name
|
QDir
::
IgnoreCase
,
QDir
::
Files
);
QDir
dir
(
"ts/"
,
"*.
qm
"
,
QDir
::
Name
|
QDir
::
IgnoreCase
,
QDir
::
Files
);
QStringList
tss
=
dir
.
entryList
();
m_ui
.
comboBoxLanguage
->
setInsertPolicy
(
QComboBox
::
InsertAlphabetically
);
...
...
@@ -43,7 +43,7 @@ LanguagePreferences::LanguagePreferences( QWidget *parent )
{
QString
localeStr
;
int
localePos
=
tsFileName
.
lastIndexOf
(
"vlmc_"
);
int
dotPos
=
tsFileName
.
lastIndexOf
(
".
ts
"
);
int
dotPos
=
tsFileName
.
lastIndexOf
(
".
qm
"
);
if
(
localePos
<
0
||
dotPos
<
0
)
{
qWarning
()
<<
"Invalid translation file:"
<<
tsFileName
;
...
...
@@ -52,6 +52,8 @@ LanguagePreferences::LanguagePreferences( QWidget *parent )
localePos
+=
5
;
localeStr
=
tsFileName
.
mid
(
localePos
,
dotPos
-
localePos
);
QLocale
locale
(
localeStr
);
qDebug
()
<<
"Adding new language:"
<<
QLocale
::
countryToString
(
locale
.
country
()
)
<<
'/'
<<
QLocale
::
languageToString
(
locale
.
language
()
)
<<
"with locale"
<<
localeStr
;
m_ui
.
comboBoxLanguage
->
addItem
(
QLocale
::
countryToString
(
locale
.
country
()
)
+
" / "
+
QLocale
::
languageToString
(
locale
.
language
()
),
localeStr
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment