ors%2Ftranslate.html&sa=D&sntz=1&usg=AFQjCNHcUyb-1nQRlT_UOEaznW39nRHF_Q>
>>
>> to apply translate behaviour to my models I detected some problems, but I
>> don't know if I'm following bad the guide or if the guide needs to be
>> improved.
>>
>
.html to apply
> translate behaviour to my models I detected some problems, but I don't know
> if I'm following bad the guide or if the guide needs to be improved.
>
> Let me explain using an example.
>
> I had this table in my system and wanted to apply transla
s table in my system and wanted to apply translate behavior.
CREATE TABLE `boards` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
So I added this to BoardsTable
I have the 'Post' and 'Attachment' models, through which I need to save and
display the results in multiple languages. Model 'Post' hasmany
'Attachment', the latter each have a caption fields, which should be
translated into different languages.
Saving the translated value of these models work
try
$this->Model->saveAssociated($data);
On Monday, May 7, 2012 2:33:41 PM UTC+1, manzapanza wrote:
>
> I'm trying to Save and Validate categories with 3 translations for the
> field 'name' using TranslateBehavior.
> I have a problem with the validation of the field with Translation.
>
> Mode
Use search terms: multiple language forms
W dniu sobota, 6 lipca 2013 01:21:53 UTC+2 użytkownik K3 napisał:
>
> Hi,
>
> when i insert a record to a model that has Translate behavior attached,
> beside the record in models table, new records are inserted to the i18n
> table
I also have many problems with the translate behavior and fields display and
save
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP"
Hi,
when i insert a record to a model that has Translate behavior attached,
beside the record in models table, new records are inserted to the i18n
table as well.
for example
in the post model i have:
'Translate' => array(
'title', 'description'
),
and wh
Hi manzapanza,
Did you solve this issue?I have the same problem and is driving me crazy!
Thanks in advance
El martes, 8 de mayo de 2012 14:20:37 UTC+2, manzapanza escribió:
>
> Some suggestions?
> Thanks!
>
> Il giorno lunedì 7 maggio 2012 10:33:41 UTC-3, manzapanza ha scritto:
>>
>> I'm trying
Hi Kicaj and thanks for your post, I stumbled upon it before to start the
internationalization of project.
It was helpful but my main problem is that I can't save data with
validation, I have to turn them off on my save($data,false) and I can't
figure why it won't work!
--
Like Us on FaceBook
Read my article on bakery site:
http://bakery.cakephp.org/articles/kicaj/2013/01/27/internationalization_with_static_and_dynamic_content_routing_and_switching
W dniu wtorek, 2 kwietnia 2013 05:06:25 UTC+2 użytkownik Livin Inchina
napisał:
>
> Hi everyone!
>
> I'm having a hard time making my web
Hi everyone!
I'm having a hard time making my website multilingual and I after going
through the net seeking for answers, I found out that I wasn't the first
one to have these issues with version 2.x.
I'm trying to translate my blog. So I have a Post.php model, a
PostsController.php and a view
Thanks
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to cake-p
This problem has come up often. If you search "cakephp translate
belongsto" you'll see some interesting fixes. I don't know if recent
versions make these unnecessary, though, so there may be a new
"standard" way to address this. Certainly, you should always consider
the date that something was post
EDIT
Now in PricePeriodController :: index should return results in the
default language. Everything works except that I can not get the localized *
Apartment.name*.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received thi
Hi,
I ask for advice,
how to return a translated result from a related model, where we have the
following relationship:
PricePeriod belongsTo Apartment
Now in PricePeriodController :: index should return results in the default
language. Everything works except that I can not get the localized n
Hi people. I have a model which is loading another model(since it's not
related to it) with loadModel.
So suppose i need to load the Category model into the Setting model and
then find('list') of all the categories. The Category model actsAs
Translate, and has a couple of fields translated. Whe
Some suggestions?
Thanks!
Il giorno lunedì 7 maggio 2012 10:33:41 UTC-3, manzapanza ha scritto:
>
> I'm trying to Save and Validate categories with 3 translations for the
> field 'name' using TranslateBehavior.
> I have a problem with the validation of the field with Translation.
>
> Model/Cate
I'm trying to Save and Validate categories with 3 translations for the
field 'name' using TranslateBehavior.
I have a problem with the validation of the field with Translation.
Model/Category.php
public $actsAs = array('Translate' => array('name' => 'MyTranslateName'));
> public $validate = ar
g (or
configuring, if it is actually possible) the translate behavior to
remove the fallback content logic.
You could change the default translate language to be the current
locale - that would also limit the translate behavior to return only
articles in the current locale. I haven't tried th
> > just return nothing ?
> > > of course one would loop through the result and do some tests then
> > > unset() the record, and alter paging params accordingly but this is a
> > > waste of cycles.
>
> > > Any thoughts are welcome
>
> > In that circumsta
telling cake not to grab the default fields and
> > just return nothing ?
> > of course one would loop through the result and do some tests then
> > unset() the record, and alter paging params accordingly but this is a
> > waste of cycles.
>
> > Any thoughts are w
do some tests then
> unset() the record, and alter paging params accordingly but this is a
> waste of cycles.
>
> Any thoughts are welcome
In that circumstance does the translate behavior actually help you
(from your description it sounds like you are using it), it's designed
to d
Hello,
Is there a way to implement this scenario:
Post is written in locale EN, if locale FR is selected, and there is
no FR translation available for the Post, return nothing.
Currently it returns the default fields found in the posts table.
I'd guess that first, there should be a way to specif
I'm creating a multilingual site using the Translate behavior. Looking
at the CakePHP docs and some blogposts it is clear that we use a i18n
table (or few tables for i18n), attach the Translate and tables to
every model and remove the international fields from original tables.
If we don
On Tue, Aug 24, 2010 at 9:48 AM, sujandhakal wrote:
> I'm implementing a cms with multilingual content. i wan to implement
> Translate behavior to the model. Actually I've implemented some of the
> code but its not what i want.
>
> This is my Post Model
>
&g
I'm implementing a cms with multilingual content. i wan to implement
Translate behavior to the model. Actually I've implemented some of the
code but its not what i want.
This is my Post Model
array(
'title','description'
));
}
?>
I want
I would make the data schema design the same or consistent regardless
of the language.
Anytime you introduce a special case to your design you really
complicate the supporting code for reading, writing and displaying the
data. You'll end up doing all kinds of conditional checking for that
one speci
for example, i have posts table and i18n table. posts table already
have data in english so i created data of the other language in i18n.
i was wondering if there's a way to retrieve data from posts table
when language is english. or do i have to create english data in i18n
table?
Check out the n
Hi,
I've got the translate behavior working. I'm wondering if there is a
way to return the translated fields indexed by locale?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group
maybe put in before find in B $this->B->behaviors->attach
('Translate'); its stupid solutions but maybe work..
On 2 Lis, 16:43, Marco wrote:
> Had to add some facts:
>
> I removed AppModel's beforeFind and beforeSave (I forgot to write
> Config.language, whic
Had to add some facts:
I removed AppModel's beforeFind and beforeSave (I forgot to write
Config.language, which is used by Translate Behavior). So forget about
these lines.
Another important thing is, that field_a and field_b in my real world
app are named equal. But tested it also
Hi guys,
i'm trying to combine Containable and Translate Behavior.
My setup:
Models:
A hasMany B
A Translate = 'field_a'
B belongsTo A
B Translate = 'field_b'
Controllers:
A->contain('B');
A->read(null, $id);
AppModel:
beforeFind:
$this->locale =
I created a helper for this to format the list for forms, I'm asking
because maybe there's a better way than the helper I've created.
On Oct 13, 7:00 pm, brian wrote:
> On Tue, Oct 13, 2009 at 11:19 AM, Rawna wrote:
>
> > I was wondering if CakePHP got it stored somewhere. Maybe from the
> > L1
On Tue, Oct 13, 2009 at 11:19 AM, Rawna wrote:
>
> I was wondering if CakePHP got it stored somewhere. Maybe from the
> L10n class?
Yes, look at the source for the L10n class. Use get().
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
I was wondering if CakePHP got it stored somewhere. Maybe from the
L10n class?
On Oct 13, 6:43 pm, leop wrote:
> > Let's
> > say I want to get the German or Korean locale code, is there an easy
> > way of getting them? Like a function perhaps?
>
> Get it from where?
--~--~-~--~~-
> Let's
> say I want to get the German or Korean locale code, is there an easy
> way of getting them? Like a function perhaps?
Get it from where?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To po
I know by default cake uses 'en_us' as the default locale code. Let's
say I want to get the German or Korean locale code, is there an easy
way of getting them? Like a function perhaps?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Thanks a lot my friend !
Your english is very cool and your post was very helpfool.
Kind regards ! :)
On 3 Σεπτ, 14:23, Jaime Dominguez wrote:
> I'm struggling with translate too but I'll try to help.
>
> Every line in the i18n table it should have the model, the locale, the
> foreign key to
I'm struggling with translate too but I'll try to help.
Every line in the i18n table it should have the model, the locale, the
foreign key to the model item id and the translated content.
If you want to translate only one field per item only one row should
be added to the i18n table so what I se
There is none who can help me ? ? ?
--~--~-~--~~~---~--~~
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-p
Hello all :)
I use the Translate Behavior normaly but I'm not sure if the way I'm
using it is the correct, that's why I need your help !
Tha way I use it is this
var $actsAs = array(
'Translate'=>array(
'name'=>'nameTranslat
Ok, nevermind :) Simply the problem as above is when there is some
entries with translated fields and then you add another field to
Translate Behavior. The solution is to add this field to forms and re-
save record - it'll create rows in i18n table with empty content.
Works perfect.
O
Hi all,
I've following problem - simple model: Shop (id, url, title) and title
field can be translated and is not obligatory, so can be NULL.
I've defined TranslateBehavior in Shop model like that:
public $actsAs = array(
'Translate' => array(
'titl
Hi everyone
I'm trying to get CakePHP to translate stuff for me, and I recently
followed the book on the Translate behavior and all is working fine...
kind of.
I have a model (lets say 'UserProfile') that $actsAs Translate. The
UserProfile model belongsTo a User model, a
Hi,
> I had the same problem couple weeks ago. The paginationCount function
> doesn't work well with i18n tabel. It gets confused on table name.
> Luckily we can overwrite this function to return us a proper number of
> records. It's a bit tricky I think but it works well for me.
Tremendous! You
Hi Guys,
I had the same problem couple weeks ago. The paginationCount function
doesn't work well with i18n tabel. It gets confused on table name.
Luckily we can overwrite this function to return us a proper number of
records. It's a bit tricky I think but it works well for me.
1. Put these samp
> Any idea how can I make for example pagination use the current locale
> in a model that $actsAs Translate?
OK, got through a part of it, but sadly paginator count doesn't work...
What I have in find conditions is:
$conditions['I18n__title.content LIKE'] = '%' .
$this->data['Article']['title']
Hello,
Any idea how can I make for example pagination use the current locale
in a model that $actsAs Translate?
Any help would be great.
Regards,
Piotr
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" gro
Hello,
It is my understanding that the Translate Behavior is not capable of
translating associated models.
Would someone be kind enough to confirm/infirm this ?
thanks you in advance
thomas
--~--~-~--~~~---~--~~
You received this message because you are
dear all
i m new for cakephp and i need help and support from you all.
when i use Translate Behavior my combo (dropdown) field changes as per
locale choice but the id it save in the transaction table is diffrent
for the same field.
is it possible to get the same id whatever laguage i save.
Kindly
Thank you!
Is that =)
Henrique Machado
2009/4/24 jitka (poLK)
>
> $label = __('Title', true);
> echo $form->input('Post.title.cze', array('type' => 'text', 'label' =>
> $label . ' (cze)'));
> echo $form->input('Post.title.eng', array('type' => 'text', 'label' =>
> $label . ' (eng)'));
>
>
$label = __('Title', true);
echo $form->input('Post.title.cze', array('type' => 'text', 'label' =>
$label . ' (cze)'));
echo $form->input('Post.title.eng', array('type' => 'text', 'label' =>
$label . ' (eng)'));
--~--~-~--~~~---~--~~
You received this message becau
Hello Guys..
I'm two days tryin to understand and trying to get Translate Behavior
working..
I've folowing the manual (http://book.cakephp.org/view/92/Translate)
OK, i have a table i18n and my model is ok.
After few hours looking for a example how to translate my records i found
I'm doing a multi-language dictionary.
If multiple terms of language A (TA1, TA2, TA3) have the same
translation in language B, I must take care that all versions of the
term in B (TB1, TB2, TB2) are synchronized.
Could Translate Behavior do this f
Translate Behavior should make the creation and modification dates of
the translations automatically, as is done in a model without this
behavior. I expected this feature only writing this in the model: var
$actsAs = array('Translate' => array
('translate_field
I created:
$this->Category->locale = array('fre', 'eng');
$categories = $this->Category->find('all');
pr($categories); // return array only with default language - fre
$this->set('categories', $categories);
/* How use $delete? */
$delete = array(
array('locale' => 'fre'),
array('foreign
In doubts how to use something, read test cases - they're not only
proving that old bugs are away, but also showing how are things
supposed to be used.
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/tests/cases/libs/model/behaviors/translate.test.php#L305
Read this method - it deletes few
Hmm.
I'm new in cakephp...
Maybe give somebody a hint of code :)
jitka (poLK) napisał(a):
> For 'fallback' translations, set model's $locale property to array of
> locales instead of string - if translation for field(s) and 1st locale
> in array will not be found, other ones will be tried.
> As
For 'fallback' translations, set model's $locale property to array of
locales instead of string - if translation for field(s) and 1st locale
in array will not be found, other ones will be tried.
As of notice that returned data are using fallback locale (means - not
first one in $locale array), the
How to use Translate Behavior when some fields there are no translated
and I want display default version?
..and setFlash with message 'There is no translated version (french),
and we was display default version (english)!":)
--~--~-~--~~~---~--~~
Yo
To correctly implement i18n and l10n for your purpose you need first
to create the following MySQL tables:
Categories table:
CREATE TABLE `categories` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`created` INT(10) UNSIGNED NOT NULL,
`updated` INT(10) UNSIGNED NOT NULL,
PRIMAR
,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Now I want to implement i18n and l10n. So I started to use the
Translate Behavior in the Category Model. I created the table from app/
config/sql/i18n.sql.
Everything works ... but not for my purpose.:)
Now the
see this example from the FAQ page
http://slun.ic.cz/files/books.zip
On 1 Dec, 09:13, dezpo <[EMAIL PROTECTED]> wrote:
> Hello bakers,
>
> Is it possible to use translate behavior with relations like belongsTo
> or hasOne, when relation with hasOne needs to be translated usi
Hello bakers,
Is it possible to use translate behavior with relations like belongsTo
or hasOne, when relation with hasOne needs to be translated using this
behavior?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I have been getting some SQL errors using the Translate behavior with
save/update/delete calls. It appears that the Translate Behavior
automatically adds fields to queries for model associations even if
Model->recursive is < 0. I think this might be a bug but after
reading
Hi,
I do not understand why the following code does not work properly.
I need help.
I use this Model Class :
class Product extends AppModel
{
var $name = 'Product';
var $hasOne = array(
'Post' =>
array('className'=> 'Post',
'dependent'=> t
Hi,
I can't save my data in two locale.
I explain :
I use this translate behavior in my Post Model, in association with
Product Model:
class Post extends AppModel
{
var $name = 'Post';
var $actsAs = array('Translate' => array(
Hello,
I was checking out how symfony does the database translation, and was
wondering if it wouldn't be a good idea to do it the same way. I
mean instead of creating one huge table i18n with all the translated
fields for all the tables, create translation tables for each table
that needs one.
Forgot to add: The actual translated data is just saved regularly, as
the cake translate behavior takes care of it, because the model-
>locale is set appropriately.
On Sep 27, 8:45 am, jcsiegrist <[EMAIL PROTECTED]> wrote:
> Hmm, the method createTranslations is actually used bef
Hmm, the method createTranslations is actually used before I get to
the view to enter the translation data. I needed to have a translation
of every translatable field, even if the data was empty, this was to
check for available translations of a record later on -- the translate
behavior creates
jcsiegrist, thanks for code!
The line #34 looks strange:
$this->_model->Content->save(array('I18nContent' => array('content' =>
'')));
It seems that it inserts a blank field into the table. How does it
work then?
--~--~-~--~~~---~--~~
You received this message
Wow jcsiegrist,
it works!
So far I have a basic example for it:
-
CONTROLLER sections_controller.php (partial)
-
function add() {
if (!empty($this->data)) {
view/1730054190
>
> use the mytranslated behavior as you use the built in translate
> behavior (it just extends the built-in behavior)
>
> :jean-claude
>
> On Sep 25, 8:39 am, cakeFreak <[EMAIL PROTECTED]> wrote:
>
> > Is the right way to write a contr
p.org/view/1730054190
use the mytranslated behavior as you use the built in translate
behavior (it just extends the built-in behavior)
:jean-claude
On Sep 25, 8:39 am, cakeFreak <[EMAIL PROTECTED]> wrote:
> Is the right way to write a controller function that acts directly and
>
Nobody can help me? please :-(
DavidGot wrote:
>
>
> I have a model named product where I use the translate behavior.
> I just want to translate the Desciption content of a produit
> the code is:
> class Product extends AppModel {
> var $name = 'Product';
&
I have a model named product where I use the translate behavior.
I just want to translate the Desciption content of a produit
the code is:
class Product extends AppModel {
var $name = 'Product';
var $actsAs = array('Translate' => array('Description'));
?>
This
Is the right way to write a controller function that acts directly and
only on the i18n tables?
Dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@go
Hey guys,
well, I have to actions: ADD and EDIT.
Eventually we can write a specific one: ADD_TRANSLATION
Everything works fine if I maniulate the database entries manually
after adding the first record. Namely I put the same id in table i18n
"row_id":
---
my problem yet.
>
> >http://groups.google.com/group/cake-php/browse_frm/thread/889c63d32cf...
>
> > Summarizing:
>
> > 1) The translate behavior works fine
>
> > 2) I add a record and the field "content" gets insterted with the
> > current lo
8n and translations.
>
> Nevertheless, I did not find an answer to my problem yet.
>
> http://groups.google.com/group/cake-php/browse_frm/thread/889c63d32cf...
>
> Summarizing:
>
> 1) The translate behavior works fine
>
> 2) I add a record and the field "content" gets in
Hey guys I read a long post about i18n and translations.
Nevertheless, I did not find an answer to my problem yet.
http://groups.google.com/group/cake-php/browse_frm/thread/889c63d32cfdf69/877ac273611da97e?lnk=gst&q=i18n&rnum=1#877ac273611da97e
Summarizing:
1) The translate behavi
Try to read this tutorial "p28n component":
http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial
Plug the code of the p28n tutorial in your app, with the book example
for the translate behavior.
Now the i28n behavihor will work for
Is there a way to manage several translations for an article (for
example) using Translate behavior in Cake 1.2?
I'll have English, Russian and Chinese languages in my app, and I want
a possibility to set all language versions for an article - e.g. all
aricles must have Russian version, but
Hi,
I wonder is there any better way of finding records by translated
fields than this:
$this -> Page -> find(array('I18n__url.content' => $url));
I've fields title, url and content translated. I want to search page
not by its id, but by url, which is different for every locale.
Pillow
--~--
Hi there,
I wile ago I asked help getting i18n working in Cake 1.2.
See post
http://groups.google.com/group/cake-php/browse_thread/thread/889c63d32cfdf69
Thanks to a lot of comments I did get it working. I like to contribute
something back to you all:
The following function in app_model.php wi
I'm just playing with brand new Translate Behavior. It works great. I
have only one question - is it possible to post something with the
same ID in two or more languages?
Now, when I post something, I have to switch language to write it
another language. And then, I can't modify existi
87 matches
Mail list logo