Hello there,
We are working on a platform using Ushahidi and we wanted to point out some of “improvements” that we applied to the Ushahidi code.
Problem: Localizations for Dates and Time (in Albanian) were not being shown properly in: Ushahidi_Folder/themes/default/views/reports/main.php even though the localization files are available here Ushahidi_Folder/application/i18n/sq_SQ/datetime.php and original file Ushahidi_Folder/application/i18n/en_US/datetime.php
Original main.php file
<?php echo Kohana::lang('ui_main.showing_reports_from', array(date('M d, Y', $oldest_timestamp), date('M d, Y', $latest_timestamp))); ?$ <?php echo Kohana::lang('ui_main.change_date_range'); ?>
keep in mind: You have to change the localization file datetime.php and the original in English, where months should look like this: with CAPITAL first letter
‘November’ => array(
‘abbv’ => ‘Nën’,
‘full’ => ‘Nëntor’,
),
http://pastebin.com/cn9XTUPa && http://pastebin.com/Lwh6F3fA
then we go back to main.php
We changed to this:
<?php $month_old = date('F', $oldest_timestamp); $month_new = date('F',$latest_timestamp); $r_month_old = Kohana::lang('datetime.'.$month_old.'.abbv'); $r_month_new = Kohana::lang('datetime.'.$month_new.'.abbv'); $timeframe_title = str_replace($month_old,$r_month_old, date('d F, Y', $oldest_timestamp)).' '.Kohana::lang('ui_main.through').' '.str_replace($month_new, $r_month_new,date('d F, Y', $latest_timestamp)); ?> <?php echo Kohana::lang('ui_main.showing_reports_from'); ?>
<?php echo $timeframe_title; ?>
<?php echo Kohana::lang('ui_main.change_date_range'); ?>
The other one is Time Format am&pm
<?php echo Kohana::lang('ui_main.modify_date'); ?>
<?php echo Kohana::lang('ui_main.date_time'); ?>: <?php echo Kohana::lang('ui_main.today_at')." "."".$form['incident_hour'] .":".$form['incident_minute']." ".$form['incident_ampm'].""; ?> <?php if($site_timezone != NULL): ?>(<?php echo $site_timezone; ?>)
<?php endif; ?>This is based on your language:
<?php echo Kohana::lang('ui_main.modify_date'); ?>
<?php echo Kohana::lang('ui_main.date_time'); ?>: <?php echo Kohana::lang('ui_main.today_at')." "."".$form['incident_hour'] .":".$form['incident_minute']." ".Kohana::lang('datetime.'.$form['incident_ampm']).""; ?> <?php if($site_timezone != NULL): ?>(<?php echo $site_timezone; ?>)
<?php endif; ?>