Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
9800572e
Commit
9800572e
authored
3 years ago
by
bgm
Committed by
bgm
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
translation#71
getFullMonthNames: do not rely on the operating system locale for translation
parent
d32b0c38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Report/Form.php
+2
-14
2 additions, 14 deletions
CRM/Report/Form.php
CRM/Utils/Date.php
+20
-9
20 additions, 9 deletions
CRM/Utils/Date.php
with
22 additions
and
23 deletions
CRM/Report/Form.php
+
2
−
14
View file @
9800572e
...
...
@@ -1361,20 +1361,8 @@ class CRM_Report_Form extends CRM_Core_Form {
!
is_array
(
$field
[
'options'
])
||
empty
(
$field
[
'options'
])
)
{
// If there's no option list for this filter, define one.
$field
[
'options'
]
=
[
1
=>
ts
(
'January'
),
2
=>
ts
(
'February'
),
3
=>
ts
(
'March'
),
4
=>
ts
(
'April'
),
5
=>
ts
(
'May'
),
6
=>
ts
(
'June'
),
7
=>
ts
(
'July'
),
8
=>
ts
(
'August'
),
9
=>
ts
(
'September'
),
10
=>
ts
(
'October'
),
11
=>
ts
(
'November'
),
12
=>
ts
(
'December'
),
];
$field
[
'options'
]
=
CRM_Utils_Date
::
getFullMonthNames
();
// Add this option list to this column _columns. This is
// required so that filter statistics show properly.
$this
->
_columns
[
$table
][
'filters'
][
$fieldName
][
'options'
]
=
$field
[
'options'
];
...
...
This diff is collapsed.
Click to expand it.
CRM/Utils/Date.php
+
20
−
9
View file @
9800572e
...
...
@@ -237,16 +237,27 @@ class CRM_Utils_Date {
*
*/
public
static
function
&
getFullMonthNames
()
{
static
$fullMonthNames
;
if
(
!
isset
(
$fullMonthNames
))
{
// set LC_TIME and build the arrays from locale-provided names
CRM_Core_I18n
::
setLcTime
();
for
(
$i
=
1
;
$i
<=
12
;
$i
++
)
{
$fullMonthNames
[
$i
]
=
strftime
(
'%B'
,
mktime
(
0
,
0
,
0
,
$i
,
10
,
1970
));
}
if
(
empty
(
\Civi
::
$statics
[
__CLASS__
][
'fullMonthNames'
]))
{
// Not relying on strftime because it depends on the operating system
// and most people will not have a non-US locale configured out of the box
// Ignoring other date names for now, since less visible by default
\Civi
::
$statics
[
__CLASS__
][
'fullMonthNames'
]
=
[
1
=>
ts
(
'January'
),
2
=>
ts
(
'February'
),
3
=>
ts
(
'March'
),
4
=>
ts
(
'April'
),
5
=>
ts
(
'May'
),
6
=>
ts
(
'June'
),
7
=>
ts
(
'July'
),
8
=>
ts
(
'August'
),
9
=>
ts
(
'September'
),
10
=>
ts
(
'October'
),
11
=>
ts
(
'November'
),
12
=>
ts
(
'December'
),
];
}
return
$fullMonthNames
;
return
\Civi
::
$statics
[
__CLASS__
][
'fullMonthNames'
];
}
/**
...
...
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