View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0010929 | mantisbt | localization | public | 2009-09-12 19:26 | 2009-10-07 14:19 |
| Reporter | Danez | Assigned To | dhx | ||
| Priority | low | Severity | tweak | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | PC | OS | Windows | OS Version | Vista |
| Product Version | 1.2.0rc1 | ||||
| Target Version | 1.2.0rc2 | Fixed in Version | 1.2.0rc2 | ||
| Summary | 0010929: Use localizeable function strftime() instead of date() | ||||
| Description | In the file /core/date_api.php in function print_month_option_list() you use date('F',...) . This always outputs the month in english regardless which locale is set. | ||||
| Steps To Reproduce | To reproduce switch to something other then english and use the month-selectbox in the date-filter on the view issue page. | ||||
| Additional Information | It would be better to use strftime (http://php.net/strftime) in conjunction with setlocale (http://php.net/setlocale). | ||||
| Tags | patch | ||||
| Attached Files | strings_english.patch (653 bytes)
--- strings_english.txt.orig Sun Sep 13 10:11:50 2009 +++ strings_english.txt Sun Sep 13 10:11:56 2009 @@ -1601,3 +1601,17 @@ $s_database_information = 'MantisBT Database Information'; $s_path_information = 'MantisBT Path Information'; +# months + +$s_month_january = 'January'; +$s_month_february = 'February'; +$s_month_march = 'March'; +$s_month_april = 'April'; +$s_month_may = 'May'; +$s_month_june = 'June'; +$s_month_july = 'July'; +$s_month_august = 'August'; +$s_month_september = 'September'; +$s_month_october = 'October'; +$s_month_november = 'November'; +$s_month_dezember = 'Dezember'; \ No newline at end of file date_api.patch (609 bytes)
--- date_api.php.orig Sun Sep 13 10:04:36 2009
+++ date_api.php Sun Sep 13 10:05:30 2009
@@ -89,9 +89,9 @@
for( $i = 1;$i <= 12;$i++ ) {
$month_name = date( 'F', mktime( 0, 0, 0, $i, 1, 2000 ) );
if( $i == $p_month ) {
- echo "<option value=\"$i\" selected=\"selected\">$month_name</option>";
+ echo "<option value=\"$i\" selected=\"selected\">" . lang_get( 'month_' . strtolower($month_name)) . "</option>";
} else {
- echo "<option value=\"$i\">$month_name</option>";
+ echo "<option value=\"$i\">" . lang_get( 'month_' . strtolower($month_name)) . "</option>";
}
}
}
| ||||
|
I thought about it a little bit more and came to the conclusion that using strftime() is still bad, because most don't have all locales installed on their servers. |
|
|
Fixed there: |
|
|
Thanks! Committed to 1.2.x as well as 1.3.x because a lack of localisation of the month selection list is a defect that will impact international users. |
|
|
MantisBT: master-1.2.x 5f78466f 2009-09-20 07:40 Committer: dhx Details Diff |
Fix 0010929: Use localizeable function strftime() instead of date() This commit adds the possibility to translate month names in lang-files. Signed-off-by: David Hicks <hickseydr@optusnet.com.au> |
Affected Issues 0010929 |
|
| mod - lang/strings_english.txt | Diff File | ||
| mod - core/date_api.php | Diff File | ||
|
MantisBT: master 1ad85ad6 2009-09-20 07:40 Committer: dhx Details Diff |
Fix 0010929: Use localizeable function strftime() instead of date() This commit adds the possibility to translate month names in lang-files. Signed-off-by: David Hicks <hickseydr@optusnet.com.au> |
Affected Issues 0010929 |
|
| mod - lang/strings_english.txt | Diff File | ||
| mod - core/date_api.php | Diff File | ||
|
MantisBT: master-1.2.x 2c505b17 2009-09-22 03:44 Details Diff |
Issue 0010929: Fix typo dezember=>december There was a typo with the spelling of "December" in commit 1ad85ad6c1276e4ef0632c31637185f62e7e873d |
Affected Issues 0010929 |
|
| mod - lang/strings_english.txt | Diff File | ||
|
MantisBT: master 5814da84 2009-09-22 03:44 Details Diff |
Issue 0010929: Fix typo dezember=>december There was a typo with the spelling of "December" in commit 1ad85ad6c1276e4ef0632c31637185f62e7e873d |
Affected Issues 0010929 |
|
| mod - lang/strings_english.txt | Diff File | ||