-
AuthorPosts
-
June 20, 2008 at 10:09 am #254937
I have made a translation to norwegian.
But there seems to be an error. Se http://sulkesligaen.no You will se the date saying NAME OF THE DAY, DATE IN THE MONTH. Generelt (default) 2008.
How can I make it to show the name of the month instead of generelt?My code
<div class="ja-day">
<?php
$day = date("l");
$daynum = date("j");
$month = date("m");
$year = date("Y");switch($day)
{
case "Monday": $day = "Mandag"; break;
case "Tuesday": $day = "Tirsdag"; break;
case "Wednesday": $day = "Onsdag"; break;
case "Thursday": $day = "Torsdag"; break;
case "Friday": $day = "Fredag"; break;
case "Saturday": $day = "Lørdag"; break;
case "Sunday": $day = "Søndag"; break;
default: $day = "Generelt"; break;
}switch($month)
{
case "January": $month = ".Januar"; break;
case "February": $month = ".Februar"; break;
case "March": $month = ".Mars"; break;
case "April": $month = ".April"; break;
case "May": $month = ".Mai"; break;
case "June": $month = ".Juni"; break;
case "July": $month = ".Juli"; break;
case "August": $month = ".August"; break;
case "September": $month = ".September"; break;
case "October": $month = ".Oktober"; break;
case "November": $month = ".November"; break;
case "December": $month = ".Desember"; break;
default: $month = ".Generelt"; break;
}echo "<span>".$day."</span>";
echo " <div>".date('j')." ".$month."</div>"; //* to change font, color, ecc... you have to modify templates/ja_teline_ii/css/template.css -> ja-day *//
echo " <span>".date ('Y')."</span>";
?>
</div>
gaygiorgia Friendgaygiorgia
- Join date:
- June 2008
- Posts:
- 218
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 15 times in 1 posts
June 20, 2008 at 10:52 am #254944<em>@fistersn 60680 wrote:</em><blockquote>I have made a translation to norwegian.
But there seems to be an error. Se http://sulkesligaen.no You will se the date saying NAME OF THE DAY, DATE IN THE MONTH. Generelt (default) 2008.
How can I make it to show the name of the month instead of generelt?My code
<div class="ja-day">
<?php
$day = date("l");
$daynum = date("j");
$month = date("m");
$year = date("Y");switch($day)
{
case "Monday": $day = "Mandag"; break;
case "Tuesday": $day = "Tirsdag"; break;
case "Wednesday": $day = "Onsdag"; break;
case "Thursday": $day = "Torsdag"; break;
case "Friday": $day = "Fredag"; break;
case "Saturday": $day = "Lørdag"; break;
case "Sunday": $day = "Søndag"; break;
default: $day = "Generelt"; break;
}switch($month)
{
case "January": $month = ".Januar"; break;
case "February": $month = ".Februar"; break;
case "March": $month = ".Mars"; break;
case "April": $month = ".April"; break;
case "May": $month = ".Mai"; break;
case "June": $month = ".Juni"; break;
case "July": $month = ".Juli"; break;
case "August": $month = ".August"; break;
case "September": $month = ".September"; break;
case "October": $month = ".Oktober"; break;
case "November": $month = ".November"; break;
case "December": $month = ".Desember"; break;
default: $month = ".Generelt"; break;
}echo "<span>".$day."</span>";
echo " <div>".date('j')." ".$month."</div>"; //* to change font, color, ecc... you have to modify templates/ja_teline_ii/css/template.css -> ja-day *//
echo " <span>".date ('Y')."</span>";
?>
</div>
</blockquote>
U red nothing what i’ve written right?? :p
U only copied the code… lol.
The correct process is:
1) read all,
2) copy the code.
Otherwise it happens that u understand nothing…Your problem is linked to the function
date('m')
if u visit this website i’ve already linked u know date(‘m’) output is: [01], [02], [03],…,[12]
in my code date(‘m’) is sostituded by date(‘M’), which output is: [Jan],[Feb],…,.
If u want to use your cases with extended names u have to change function date(‘m’) with function date(‘F’) which output is: [January],[February],…,.
and DELETE this rows:
$daynum = date(“j”);
$year = date(“Y”);
because u directly use the function, you do not need to insert them into a phpvariable…Ok? 🙂
1 user says Thank You to gaygiorgia for this useful post
June 20, 2008 at 9:51 pm #255063Thanks alot for the help. I confess that I haven’t red your post that wellm, but as my excuse I will say that I have used many hours now to get this template to work.
trinhnfs Friendtrinhnfs
- Join date:
- March 2007
- Posts:
- 56
- Downloads:
- 3
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 25, 2008 at 7:59 pm #256218🙂
Hi, in Vietnamese, what can I do ?
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
June 26, 2008 at 7:07 am #256318Hi trinh !
<em>@onboom 51525 wrote:</em><blockquote>Vietnamese – Tiếng Việt Nam:
Fix update:
[PHP]
<div class=”ja-day”>
<?php
$day = date(“l”);
$daynum = date(“j”);
$month = date(“M”);
$year = date(“Y”);switch($day)
{
case “Monday”: $day = “Thứ Hai, ngày”; break;
case “Tuesday”: $day = “Thứ Ba, ngày”; break;
case “Wednesday”: $day = “Thứ Tư, ngày”; break;
case “Thursday”: $day = “Thứ Năm, ngày”; break;
case “Friday”: $day = “Thứ Sáu, ngày”; break;
case “Saturday”: $day = “Thứ Bảy, ngày”; break;
case “Sunday”: $day = “Chủ Nhật, ngày”; break;
default: $day = “Ngày”; break;
}switch($month)
{
case “January”: $month = “Tháng 1, năm”; break;
case “February”: $month = “Tháng 2, năm”; break;
case “March”: $month = “Tháng 3, năm”; break;
case “April”: $month = “Tháng 4, năm”; break;
case “May”: $month = “Tháng 5, năm”; break;
case “June”: $month = “Tháng 6, năm”; break;
case “July”: $month = “Tháng 7, năm”; break;
case “August”: $month = “Tháng 8, năm”; break;
case “September”: $month = “Tháng 9, năm”; break;
case “October”: $month = “Tháng 10, năm”; break;
case “November”: $month = “Tháng 11, năm”; break;
case “December”: $month = “Tháng 12, năm”; break;
default: $month = “Tháng”; break;
}echo $day . ” ” . $daynum . ” ” . $month . ” ” . $year;
?>
</div>
[/PHP]
————————————–
Sample site here:
Ja Teline II – Vietnamese</blockquote>good luck !
1 user says Thank You to Sherlock for this useful post
trinhnfs Friendtrinhnfs
- Join date:
- March 2007
- Posts:
- 56
- Downloads:
- 3
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 26, 2008 at 10:44 pm #256499Thanks 🙂
By the way, take a look at my site. Dreams.vn. I have a new server and re-installer this CMS, but some thing out :
Warning: mkdir() [function.mkdir]: Unable to access /home/dreams/domains/dreams.vn/public_html/images/resized/ in /home/dreams/domains/dreams.vn/public_html/modules/mod_janews/helper.php on line 102.
Best Regards
Trinh
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
June 27, 2008 at 2:02 am #256537Hi trinhnfs !
Please change permission for images folder to 755 or 777.trinhnfs Friendtrinhnfs
- Join date:
- March 2007
- Posts:
- 56
- Downloads:
- 3
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 27, 2008 at 1:38 pm #256735Hi 🙂
images folder permission hate been changed, but nothing happend, and is there anything about security ???
Thanks
July 6, 2008 at 5:25 am #258108And what must i paste for German Date Form…
Give News please…
Ltd.Lupo
gaygiorgia Friendgaygiorgia
- Join date:
- June 2008
- Posts:
- 218
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 15 times in 1 posts
July 6, 2008 at 8:57 am #258130<em>@id31 64489 wrote:</em><blockquote>And what must i paste for German Date Form…
Give News please…
Ltd.Lupo</blockquote>For german date form u have to paste any code u see here.
u have only to translate days and months in your language… Even a child can do it….July 7, 2008 at 5:16 am #258261That is easy translate the month and days…
But what about the [PHP] <div class=”ja-day”>
<?php
$day = date(“l”);
$daynum = date(“j”);
$month = date(“M”);
$year = date(“Y”);switch($day)
{
case “Monday”: $day = “Montag”; break;
case “Tuesday”: $day = “Dienstag”; break;
case “Wednesday”: $day = “Mittwoch”; break;
case “Thursday”: $day = “Donnerstag”; break;
case “Friday”: $day = “Freitag”; break;
case “Saturday”: $day = “Samstag”; break;
case “Sunday”: $day = “Sonntag”; break;
default: $day = “Onbekend”; break;
}switch($month)
{
case “January”: $month = “Januar”; break;
case “February”: $month = “Februar”; break;
case “March”: $month = “März”; break;
case “April”: $month = “April”; break;
case “May”: $month = “Mai”; break;
case “June”: $month = “Juni”; break;
case “July”: $month = “Juli”; break;
case “August”: $month = “August”; break;
case “September”: $month = “September”; break;
case “October”: $month = “Oktober”; break;
case “November”: $month = “November”; break;
case “December”: $month = “Dezember”; break;
default: $month = “Onbekend”; break;
}echo $day . ” ” . $daynum . ” ” . $month . ” ” . $year;
?>
</div>[/PHP]but the two lines…
default: $day = “Onbekend”; break;
and
default: $month = “Onbekend”; break;
Give News please…
gaygiorgia Friendgaygiorgia
- Join date:
- June 2008
- Posts:
- 218
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 15 times in 1 posts
July 7, 2008 at 6:39 am #258268default: $day = “undefinited”; break;
default: $month = “undefinited”; break;translate in your language, or, if u prefer, siply ignore them.
Them will be showed only if a different non expected day or month (we are speaking of server variable about) occurs. For example:
– day “fri-sunday”, month “ago-cember” (ahahah impossible)
or more a more realistic example:
– “Mon” (server output) -> in case of “Monday” show me “Montag” -> since “Monday” is not occurred u’ll have got an “undefinited” as output.
Is it clear?July 9, 2008 at 3:16 pm #258803<em>@apitsch 51470 wrote:</em><blockquote>Hi PGLion,
yes your code works on my site. And here the code for the german language:<div class="ja-day">
<?php
$day = date("l");
$daynum = date("j");
$month = date("M");
$year = date("Y");switch($day)
{
case "Monday": $day = "Montag"; break;
case "Tuesday": $day = "Dienstag"; break;
case "Wednesday": $day = "Mittwoch"; break;
case "Thursday": $day = "Donnerstag"; break;
case "Friday": $day = "Freitag"; break;
case "Saturday": $day = "Samstag"; break;
case "Sunday": $day = "Sonntag"; break;
default: $day = "Onbekend"; break;
}switch($month)
{
case "January": $month = "Januar"; break;
case "February": $month = "Februar"; break;
case "March": $month = "Maerz"; break;
case "April": $month = "April"; break;
case "May": $month = "Mai"; break;
case "June": $month = "Juni"; break;
case "July": $month = "Juli"; break;
case "August": $month = "August"; break;
case "September": $month = "September"; break;
case "October": $month = "Oktober"; break;
case "November": $month = "November"; break;
case "December": $month = "Dezember"; break;
default: $month = "Onbekend"; break;
}echo $day . ", " . $daynum . ". " . $month . " " . $year;
?>
</div>
</blockquote>
Thank’s a lot. It works …more or less: I now get the date: Mittwoch, 9. Onbekend 2008 . What is “Onbekend” (instead of “Juli”)???jbgorg Friendjbgorg
- Join date:
- April 2008
- Posts:
- 80
- Downloads:
- 0
- Uploads:
- 11
- Thanks:
- 13
- Thanked:
- 3 times in 1 posts
July 9, 2008 at 5:26 pm #258821Hi, Thanks for your help. May you tell me what’s the function of this line: default: $month = “Onbekend”; break; ? Another one I have added the code in a developer environmet all is ok but the month keeps in english, any idea? The code in spanish I’m using:
<div class=”ja-day”>
<?php
$day = date(“l”);
$daynum = date(“j”);
$month = date(“M”);
$year = date(“Y”);switch($day)
{
case “Monday”: $day = “Lunes”; break;
case “Tuesday”: $day = “Martes”; break;
case “Wednesday”: $day = “Miécoles”; break;
case “Thursday”: $day = “Jueves”; break;
case “Friday”: $day = “Viernes”; break;
case “Saturday”: $day = “Sábado”; break;
case “Sunday”: $day = “Domingo”; break;}
switch($month)
{
case “January”: $month = “Enero”; break;
case “February”: $month = “Febrero”; break;
case “March”: $month = “Marzo”; break;
case “April”: $month = “Abril”; break;
case “May”: $month = “Mayo”; break;
case “June”: $month = “Junio”; break;
case “July”: $month = “Julio”; break;
case “August”: $month = “Agosto”; break;
case “September”: $month = “Septiembre”; break;
case “October”: $month = “Octubre”; break;
case “November”: $month = “Noviembre”; break;
case “December”: $month = “Diciembre”; break;}
echo $day . ” ” . $daynum . ” ” . $month . ” ” . $year;
?>2 users say Thank You to jbgorg for this useful post
orpheus2510 Friendorpheus2510
- Join date:
- July 2007
- Posts:
- 149
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 14 times in 1 posts
July 15, 2008 at 6:19 pm #259973<em>@kohrs 65330 wrote:</em><blockquote>Thank’s a lot. It works …more or less: I now get the date: Mittwoch, 9. Onbekend 2008 . What is “Onbekend” (instead of “Juli”)???</blockquote>
For Germans: Onbekend (niederl.) = Unbekannt!
Take from the english names of months only the first three letters – then it works. -
AuthorPosts
This topic contains 91 replies, has 47 voices, and was last updated by juremmm 14 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum