Home > Archive > PHP Smarty Templates > April 2005 > Re: [SMARTY] Problem with languages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] Problem with languages
|
|
| Mario St-Gelais 2005-04-14, 3:59 am |
| I tried to use html_select_date without much success. In my case, I
wanted the month to appear in French. So on my entry form i did :
<select name=selected_day_id>
{html_options values=$day_id
selected=$selected_day_id output=$day_id}
</select>
<select name=selected_month_id>
{html_options values=$month_id
selected=$selected_month_id output=$month_name}
</select>
<select name=selected_year_id>
{html_options values=$year_id
selected=$selected_year_id output=$year_id}
</select>
{assign var="ddn"
value=" $selected_month_id,$selected_day_id,$sel
ected_year_id"}
It is basically one html_option for each of day of the month, month of
the year and the year. I assign the values in variable "ddn" for
further processing. Then I have an array that assigns french month to
numeral month value like so :
$smarty-> assign('month_id',array(0,1,2,3,4,5,6,7,
8,9,10,11,12));
$smarty-> assign('month_name',array('mois','janvie
r',
'février','mars','avril','mai','juin','j
uillet',
'août','septembre','octobre','novembre',
'décembre'));
Maybe not the best option but it does the trick
Reynier Perez Mira wrote:
>Hi list:
>
>I'm working with Smarty component {html_select_date prefix="fecha" time=$time start_year="1950" end_year="+1"}
>
>But this return date in english and I want it in spanish. When I put this at first into my php file
>
>setlocale(LC_ALL, 'es_ES);
>
>nothing happend and things come in english. How can I solve this problem?
>
>It's posible with Smarty? Exists any plugin or addons that return things in spanish format?
>
>Regards
>
>
>
>
>
>Reynier Pérez Mira
>
>3ero. Ing. Informática
>
>Entre más inteligente me siento, más me doy cuenta de lo ignorante que soy.
>
>
>
>
>
>
| |
| Messju Mohr 2005-04-14, 8:58 am |
| On Wed, Apr 13, 2005 at 11:00:03PM -0400, Mario St-Gelais wrote:
> I tried to use html_select_date without much success. In my case, I
> wanted the month to appear in French.
Ask your system administrator to enable french locale settings for
you.
> So on my entry form i did :
>
> <select name=selected_day_id>
> {html_options values=$day_id
> selected=$selected_day_id output=$day_id}
> </select>
> <select name=selected_month_id>
> {html_options values=$month_id
> selected=$selected_month_id output=$month_name}
> </select>
> <select name=selected_year_id>
> {html_options values=$year_id
> selected=$selected_year_id output=$year_id}
> </select>
> {assign var="ddn"
>
> value=" $selected_month_id,$selected_day_id,$sel
ected_year_id"}
>
> It is basically one html_option for each of day of the month, month of
> the year and the year. I assign the values in variable "ddn" for
> further processing. Then I have an array that assigns french month to
> numeral month value like so :
>
> $smarty-> assign('month_id',array(0,1,2,3,4,5,6,7,
8,9,10,11,12));
> $smarty-> assign('month_name',array('mois','janvie
r',
> 'février','mars','avril','mai','juin','j
uillet',
> 'août','septembre','octobre','novembre',
'décembre'));
>
> Maybe not the best option but it does the trick
>
> Reynier Perez Mira wrote:
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
|
|
|
|
|