-
AuthorPosts
-
July 21, 2008 at 11:33 pm #131162
I have tried to change the date language to Welsh, but it isn’t working. So far, I have….
Installed Welsh language pack, which works fine in most aspects.
Edited JA Teline’s index.php file, so that the JA Day section now reads<div class=”ja-day”>
<?php
setlocale(LC_TIME, “cy_GB”);
echo “<span>”.date (‘l’).”</span>”;
echo ” <div>”.date (‘M’).” “.date (‘d’).date (‘S’).”</div>”;
?>
</div>[/FONT]cy_GB being the code for Welsh (Cymraeg). But the date is still displayed in English. Why is this happening?
Please bear in mind that I have very limited knowledge of code, and am using Joomla! to avoid coding as much as possible. I need a simple, newbie answer to this question, explained in detail.
[FONT=”Arial”]Website is being built on localhost, so is not live yet.
Database Version: 5.0.51b-community-nt
Database Collation: utf8_general_ci
PHP Version: 5.2.6
Web Server: Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h mod_autoindex_color PHP/5.2.6
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.4 Production/Stable [ Naiki ] 6-July-2008 22:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
[/FONT]Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 22, 2008 at 8:49 am #261442Hi dyfrigj !
Pleasse view http://www.joomlart.com/forums/topic/date-translation-login/ to consult about change language for date. it is similar in teline.July 22, 2008 at 10:08 am #261462Hi,
I have managed to change the day names into Welsh by following the method in the link. This is the code as I have it now[FONT=”Courier New”]<div class=”ja-day”>
<?php
$day = date(“l”);
$daynum = date(“j”);
$month = date(“M”);
$year = date(“Y”);switch($day)
{
case “Monday”: $day = “Dydd Llun”; break;
case “Tuesday”: $day = “Dydd Mawrth”; break;
case “Wednesday”: $day = “Dydd Mercher”; break;
case “Thursday”: $day = “Dydd Iau”; break;
case “Friday”: $day = “Dydd Gwener”; break;
case “Saturday”: $day = “Dydd Sadwrn”; break;
case “Sunday”: $day = “Dydd Sul”; break;
default: $day = “Onbekend”; break;
}switch($month)
{
case “January”: $month = “Ionawr”; break;
case “February”: $month = “Chwefror”; break;
case “March”: $month = “Mawrth”; break;
case “April”: $month = “Ebrill”; break;
case “May”: $month = “Mai”; break;
case “June”: $month = “Mehefin”; break;
case “July”: $month = “Gorffennaf”; break;
case “August”: $month = “Awst”; break;
case “September”: $month = “Medi”; break;
case “October”: $month = “Hydref”; break;
case “November”: $month = “Tachwedd”; break;
case “December”: $month = “Rhagfyr”; break;
default: $month = “Onbekend”; break;
}echo $day . ” ” . $daynum . ” ” . $month . ” ” . $year;
?>
</div></div>
</div>[/FONT]However, there are two problems.
The first is the month name. Joomla is not recognising the new names, and is putting in the default name (Onbekend) instead of the Welsh month name. Day names work fine.
The other is to do with the appearance. By changing the name, the date no longer appears in the Teline format – it comes out as plain text (see attached screenshot).
How do I resolve these two problems?
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 23, 2008 at 2:18 am #261598Hi dyfrigj !
Please check time on my server . i think time in your server is wrong.July 24, 2008 at 7:31 am #261945The time and date works fine until I change the language options, so how can it be a problem with the server time? I would appreciate more help with this problem. My site is now live (but under construction). You can see it at
http://host.qliqdns.net/~cylchgra
Please help me out
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 24, 2008 at 7:38 am #261949Ok dyfrigj !
Please wait, i’m check your code what you are using .Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 24, 2008 at 7:54 am #261951Hi !
I have found the problem !
Please change :
switch($month)
{
case "January": $month = "Ionawr"; break;
case "February": $month = "Chwefror"; break;
case "March": $month = "Mawrth"; break;
case "April": $month = "Ebrill"; break;
case "May": $month = "Mai"; break;
case "June": $month = "Mehefin"; break;
case "July": $month = "Gorffennaf"; break;
case "August": $month = "Awst"; break;
case "September": $month = "Medi"; break;
case "October": $month = "Hydref"; break;
case "November": $month = "Tachwedd"; break;
case "December": $month = "Rhagfyr"; break;
default: $month = "Onbekend"; break;
}
to :
switch($month)
{
case "Jan": $month = "Ionawr"; break;
case "Feb": $month = "Chwefror"; break;
case "Mar": $month = "Mawrth"; break;
case "Apr": $month = "Ebrill"; break;
case "May": $month = "Mai"; break;
case "Jun": $month = "Mehefin"; break;
case "Jul": $month = "Gorffennaf"; break;
case "Aug": $month = "Awst"; break;
case "Sep": $month = "Medi"; break;
case "Oct": $month = "Hydref"; break;
case "Nov": $month = "Tachwedd"; break;
case "Dec": $month = "Rhagfyr"; break;
default: $month = "Onbekend"; break;
}
1 user says Thank You to Sherlock for this useful post
July 24, 2008 at 8:55 am #261964Thank you, this has resolved the problem with the month name.
AuthorPostsViewing 8 posts - 1 through 8 (of 8 total)This topic contains 8 replies, has 2 voices, and was last updated by dyfrigj 16 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Change date language to Welsh
Viewing 8 posts - 1 through 8 (of 8 total)