The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Thu May 17, 2012 5:04 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
hi.. how can I use the translated version of the numbering, date and time format. Right now even if I switch the language these remains the same as in english. I am talking about persian language to be specific and it has the localize.php and a javascript calendar with it..

can anyone help?


Top
 Profile  
 
PostPosted: Fri May 18, 2012 5:54 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
Registered Persian pack displays Jalali date OK here.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Fri May 18, 2012 11:47 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
i have downloaded it from joomlafarsi.com.. don't know if that is registered or not..

it does show it in articles and things but there is a date on my site which is the system date i believe which is in Gregorian calendar.. so i don't want two types of dates showing up on site.. for now can you tell me how can I use the Gregorian date and time while still using farsi language pack? thanks


Top
 Profile  
 
PostPosted: Fri May 18, 2012 4:04 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
Use packs available from here:
http://community.joomla.org/translation ... tions.html

Concerning the date displaying on your site, where does it come from? Is it template related? Is it a 3rd party extension?

To display Gregorian, one has to delete the class
class fa_IRDate extends JDate {

in fa-IR.localise.php both in site and admin lang folders

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Fri May 18, 2012 4:33 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
it seems to me that the pack i am using is registered there in that list..

the date comes due to below code within the template which is showing the date of a system itself, means whatever date i set my pc to it will show me that..

Code:
   <p class="day clearfix">
     <?php
      echo "<span class=\"day\">".JText::_(strtoupper(date ('D')))."</span>";
      echo "<span class=\"month\">".date ('m')."</span>";
      echo "<span class=\"date\">".date ('d')."</span>";
      echo "<span class=\"year\">".date ('Y')."</span>";
     ?>
   </p>


and yeah, removing that class helped me switch back to Gregorian, thanks..

what my real problem still is that how to show the dates, times or any number mentioned anywhere whether gregorian or farsi to be in their actual arabic numerals.. such as ۱ ۲ ۴ ۴ ۵... rather than 12345..?

I inspected the the farsi pack calendar js file has them mentioned somewhere in the bottom so I believe it would be possible what i want to include..

right now it really look awful showing the numerals in english while the rest of the site is in farsi..

can you help me with it please?


Top
 Profile  
 
PostPosted: Sat May 19, 2012 3:42 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
Dates can be customized by translating the Gregorian dates saved in the database, not numbers. This is the case for any language and any internet application. The "numerals" are not English specific, they are called "Western Arabic" numerals and used all over the world.
There is no way in a sql database to represent the "Eastern Arabic Numerals" you use in your language when writing or printing. If you write them, they will show, but not in lists or dates.
See http://en.wikipedia.org/wiki/Arabic_numerals

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sat May 19, 2012 5:37 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
i see.. thanks for the information.. I guess that would need a lot of work.. better leave it the way it is.. (:


Top
 Profile  
 
PostPosted: Sun May 20, 2012 4:45 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
For the date on your template, if you want a Jalali date, change the code to something like:
Code:
<p class="whatever">
<?php
$date = new JDate('now');
echo JHtml::_('date', $date, JText::_('DATE_FORMAT_LC2'));
?>
</p>


Choose the format depending on the strings that you can modify to fit
Quote:
DATE_FORMAT_LC="l, d F Y"
DATE_FORMAT_LC1="l, d F Y"
DATE_FORMAT_LC2="l, d F Y H:i"
DATE_FORMAT_LC3="d F Y"
DATE_FORMAT_LC4="Y-m-d"
DATE_FORMAT_JS1="y-m-d"

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sun May 20, 2012 6:13 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
ok thanks.. replacing the whole code is giving me the Jalali Date format as you said.. how can i keep the css formatting as well?


Top
 Profile  
 
PostPosted: Sun May 20, 2012 6:36 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
Code:
<p class="whatever">
<?php $date = new JDate('now'); ?>
<span class="year"> <?php echo JHtml::_('date', $date, 'Y')); ?></span>
<span class="month"> <?php echo JHtml::_('date', $date, 'm')); ?></span>
etc.

</p>

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sun May 20, 2012 6:58 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 07, 2011 7:11 pm
Posts: 25
Thanks man..

the actual code by the way:

Code:
<p class="day clearfix">
    <?php $date = new JDate('now'); ?>
     <?php
      echo "<span class=\"day\">".JHtml::_('date', $date, 'D')."</span>";
      echo "<span class=\"month\">".JHtml::_('date', $date, 'm')."</span>";
      echo "<span class=\"date\">".JHtml::_('date', $date, 'd')."</span>";
      echo "<span class=\"year\">".JHtml::_('date', $date, 'Y')."</span>";
     ?>
</p>


Top
 Profile  
 
PostPosted: Thu Nov 29, 2012 6:36 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Nov 29, 2012 5:56 am
Posts: 1
hi..

I using joomla 2.5.8 and tried to edit www.[Mysite.com]/libraries/joomla/utilities/date.php file and if I edit

return $abbr ? JText::_('SUN') : JText::_('SUNDAY');
To
return $abbr ? JText::_('SUN') : JText::_('[other language Day]');

And

return $abbr ? JText::_('JANUARY_SHORT') : JText::_('JANUARY');
To
return $abbr ? JText::_('JANUARY_SHORT') : JText::_('[other language Month]');

That works fine

But number in the date I cant translate



can anyone help?


Top
 Profile  
 
PostPosted: Thu Nov 29, 2012 7:25 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
Do NOT hack core files.
The dates are specific to the language pack used.
What is your language?

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Mon Dec 24, 2012 11:39 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16641
Location: **Translation Matters**
This is extremely easy using the Language overrides in Language manager

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 



Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group