Re: Translate field names

2009-10-08 Thread emmexx

Thank you Brian for the explanation.

   maxx



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-10-06 Thread emmexx

On 25 Set, 12:47, rich...@home richardath...@gmail.com wrote:
 No, you only want to translate the label, not the field name :

 echo $form-input(field_name, array(label=__(field_name)));

I tried what you suggested but the result is not what I espected.

1st attempt:

echo $form-input('table_id', array('label' = __('table_id')));

The output is:
table_id
Table
that is a label and the name of the joined table.
Unfortunately I want just one label, Table, translated if there's a
translation.

2nd attempt:
echo $form-input('table_id', array('label' = __('table_id', True)));

The output is:
table_id
I expected: Table

I'm missing something? I'm expecting too much from cake?

Thank you
   maxx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-10-06 Thread brian

Do you have a .po file containing a translation for 'table_id'? And
have you set the language?

http://book.cakephp.org/view/163/Localization-in-CakePHP

On Tue, Oct 6, 2009 at 10:54 AM, emmexx emmeics...@gmail.com wrote:

 On 25 Set, 12:47, rich...@home richardath...@gmail.com wrote:
 No, you only want to translate the label, not the field name :

 echo $form-input(field_name, array(label=__(field_name)));

 I tried what you suggested but the result is not what I espected.

 1st attempt:

 echo $form-input('table_id', array('label' = __('table_id')));

 The output is:
 table_id
 Table
 that is a label and the name of the joined table.
 Unfortunately I want just one label, Table, translated if there's a
 translation.

 2nd attempt:
 echo $form-input('table_id', array('label' = __('table_id', True)));

 The output is:
 table_id
 I expected: Table

 I'm missing something? I'm expecting too much from cake?

 Thank you
   maxx
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-10-06 Thread emmexx



On 6 Ott, 19:54, brian bally.z...@gmail.com wrote:
 Do you have a .po file containing a translation for 'table_id'? And
 have you set the language?

Not yet but I expected that without a po file, or a translation, the
label defaulted to the value used automatically by cake.
I mean, if there's a belongTo field in the table, say category_id, I
expected that the result of
echo $form-input('category_id', array('label' = __('category_id',
True)));
would be Category, not category_id. That is: no translation 
default value.
I don't expect cakephp doing all the programming work for me, just
trying to understand what cake can do for me.

Thank you
   maxx

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-10-06 Thread brian

On Tue, Oct 6, 2009 at 3:11 PM, emmexx emmeics...@gmail.com wrote:



 On 6 Ott, 19:54, brian bally.z...@gmail.com wrote:
 Do you have a .po file containing a translation for 'table_id'? And
 have you set the language?

 Not yet but I expected that without a po file, or a translation, the
 label defaulted to the value used automatically by cake.

No, if Cake can't find the key in the po file, it echoes back the key
you pass it.

 I mean, if there's a belongTo field in the table, say category_id, I
 expected that the result of
 echo $form-input('category_id', array('label' = __('category_id',
 True)));
 would be Category, not category_id. That is: no translation 
 default value.

But you've already specified the label to Cake so it's not going to
give you the automatic value.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-09-28 Thread emmexx



On 25 Set, 12:47, rich...@home richardath...@gmail.com wrote:
 No, you only want to translate the label, not the field name :

 echo $form-input(field_name, array(label=__(field_name)));

Ok, thank you, not a recipe as simple as I imagined but easy enough to
do it by hand.

bye
   maxx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-09-25 Thread emmexx



On 25 Set, 02:18, brian bally.z...@gmail.com wrote:
 __('field_name')


Do you mean that I can use in a view something like the following?

echo $form-input(__('date'));

Thanks
   maxx

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-09-25 Thread rich...@home

No, you only want to translate the label, not the field name :

echo $form-input(field_name, array(label=__(field_name)));

On Sep 25, 9:19 am, emmexx emmeics...@gmail.com wrote:
 On 25 Set, 02:18, brian bally.z...@gmail.com wrote:

  __('field_name')

 Do you mean that I can use in a view something like the following?

 echo $form-input(__('date'));

 Thanks
    maxx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Translate field names

2009-09-24 Thread brian

__('field_name')

http://book.cakephp.org/view/161/Internationalization-Localization

On Thu, Sep 24, 2009 at 4:05 PM, emmexx emmeics...@gmail.com wrote:

 I searched the bakery and here but couldn't find an answer.

 I'd like to translate all field names in a simple way.
 The Translate behaviour is useful to translate field values but I want
 to translate the field name, that is use another label for the name of
 one or more fields in a table.

 I can't believe cakephp has not a mechanism to translate field names:
 they're used in forms and views by cake...

 Thank you
   maxx

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---