Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
7db99497
Commit
7db99497
authored
May 11, 2015
by
Thomas Müller
Browse files
Merge pull request #16208 from owncloud/fix-language-selection-sr-latin
Some locales need to be converted to be compliant with CLDR
parents
f057efc4
9c57ae89
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/private/l10n.php
View file @
7db99497
...
...
@@ -385,6 +385,7 @@ class OC_L10N implements \OCP\IL10N {
if
(
$locale
===
null
)
{
$locale
=
self
::
findLanguage
();
}
$locale
=
$this
->
transformToCLDRLocale
(
$locale
);
$options
=
array_merge
(
array
(
'width'
=>
'long'
),
$options
);
$width
=
$options
[
'width'
];
...
...
@@ -538,6 +539,7 @@ class OC_L10N implements \OCP\IL10N {
*/
public
function
getDateFormat
()
{
$locale
=
$this
->
getLanguageCode
();
$locale
=
$this
->
transformToCLDRLocale
(
$locale
);
return
Punic\Calendar
::
getDateFormat
(
'short'
,
$locale
);
}
...
...
@@ -546,6 +548,15 @@ class OC_L10N implements \OCP\IL10N {
*/
public
function
getFirstWeekDay
()
{
$locale
=
$this
->
getLanguageCode
();
$locale
=
$this
->
transformToCLDRLocale
(
$locale
);
return
Punic\Calendar
::
getFirstWeekday
(
$locale
);
}
private
function
transformToCLDRLocale
(
$locale
)
{
if
(
$locale
===
'sr@latin'
)
{
return
'sr_latn'
;
}
return
$locale
;
}
}
Write
Preview
Markdown
is supported
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