Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
e6cabe27
Commit
e6cabe27
authored
Aug 10, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Fix locale names and user-visible locale names.
parent
2b26f6e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/locale/LocaleConfiguration.cpp
+3
-3
3 additions, 3 deletions
src/modules/locale/LocaleConfiguration.cpp
src/modules/locale/LocalePage.cpp
+12
-2
12 additions, 2 deletions
src/modules/locale/LocalePage.cpp
with
15 additions
and
5 deletions
src/modules/locale/LocaleConfiguration.cpp
+
3
−
3
View file @
e6cabe27
...
@@ -29,7 +29,7 @@ LocaleConfiguration::createDefault()
...
@@ -29,7 +29,7 @@ LocaleConfiguration::createDefault()
LocaleConfiguration
lc
=
LocaleConfiguration
();
LocaleConfiguration
lc
=
LocaleConfiguration
();
lc
.
lang
=
lc
.
lc_numeric
=
lc
.
lc_time
=
lc
.
lc_monetary
=
lc
.
lc_paper
=
lc
.
lc_name
lc
.
lang
=
lc
.
lc_numeric
=
lc
.
lc_time
=
lc
.
lc_monetary
=
lc
.
lc_paper
=
lc
.
lc_name
=
lc
.
lc_address
=
lc
.
lc_telephone
=
lc
.
lc_measurement
=
lc
.
lc_address
=
lc
.
lc_telephone
=
lc
.
lc_measurement
=
lc
.
lc_identification
=
"en_US.UTF-8
UTF-8
"
;
=
lc
.
lc_identification
=
"en_US.UTF-8"
;
return
lc
;
return
lc
;
}
}
...
@@ -51,7 +51,7 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
...
@@ -51,7 +51,7 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
QString
lang
;
QString
lang
;
if
(
linesForLanguage
.
length
()
==
0
||
languageLocale
.
isEmpty
()
)
if
(
linesForLanguage
.
length
()
==
0
||
languageLocale
.
isEmpty
()
)
lang
=
"en_US.UTF-8
UTF-8
"
;
lang
=
"en_US.UTF-8"
;
else
if
(
linesForLanguage
.
length
()
==
1
)
else
if
(
linesForLanguage
.
length
()
==
1
)
lang
=
linesForLanguage
.
first
();
lang
=
linesForLanguage
.
first
();
else
else
...
@@ -109,7 +109,7 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
...
@@ -109,7 +109,7 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
// Else we have an unrecognized or unsupported locale, all we can do is go with
// Else we have an unrecognized or unsupported locale, all we can do is go with
// en_US.UTF-8 UTF-8. This completes all default language setting guesswork.
// en_US.UTF-8 UTF-8. This completes all default language setting guesswork.
if
(
lang
.
isEmpty
()
)
if
(
lang
.
isEmpty
()
)
lang
=
"en_US.UTF-8
UTF-8
"
;
lang
=
"en_US.UTF-8"
;
// The following block was inspired by Ubiquity, scripts/localechooser-apply.
// The following block was inspired by Ubiquity, scripts/localechooser-apply.
...
...
This diff is collapsed.
Click to expand it.
src/modules/locale/LocalePage.cpp
+
12
−
2
View file @
e6cabe27
...
@@ -368,7 +368,13 @@ LocalePage::init( const QString& initialRegion,
...
@@ -368,7 +368,13 @@ LocalePage::init( const QString& initialRegion,
++
it
;
++
it
;
}
}
// We strip " UTF-8" from "en_US.UTF-8 UTF-8" because it's redundant redundant.
for
(
auto
it
=
m_localeGenLines
.
begin
();
it
!=
m_localeGenLines
.
end
();
++
it
)
{
if
(
it
->
endsWith
(
" UTF-8"
)
)
it
->
chop
(
6
);
*
it
=
it
->
simplified
();
}
}
}
...
@@ -448,7 +454,11 @@ LocalePage::prettyLCLocale( const QString& lcLocale )
...
@@ -448,7 +454,11 @@ LocalePage::prettyLCLocale( const QString& lcLocale )
QString
localeString
=
lcLocale
;
QString
localeString
=
lcLocale
;
if
(
localeString
.
endsWith
(
" UTF-8"
)
)
if
(
localeString
.
endsWith
(
" UTF-8"
)
)
localeString
.
remove
(
" UTF-8"
);
localeString
.
remove
(
" UTF-8"
);
return
localeString
;
QLocale
locale
(
localeString
);
//: Language (Country)
return
tr
(
"%1 (%2)"
).
arg
(
QLocale
::
languageToString
(
locale
.
language
()
)
)
.
arg
(
QLocale
::
countryToString
(
locale
.
country
()
)
);
}
}
void
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment