How I can translate plugin contact

32 views
Skip to first unread message

Nguyễn Trung

unread,
May 18, 2013, 12:09:22 AM5/18/13
to cro...@googlegroups.com
Hi every one.
I want translate plugin contact in croogo to vietnamese, I did some thing :
1. I created file: app\Locale\vie\LC_MESSAGES\default.po
2. I created file too on link: app\Locale\vie\LC_MESSAGES\default.po
3. translate some thing
#: /Controller/ContactsController.php:54
msgid "Contacts"
msgstr "Liên hệ"

#: /View/Contacts/view.ctp:23
msgid "Address"
msgstr "Địa chỉ"

msgid "Your name"
msgstr "Tên bạn"

In my theme, I placed 2 switch language link:
<?php print $this->Html->image('/images/vi.png',array('alt' => Configure::read('Site.title'),'url'=>array('locale' => 'vie'))); ?>
<?php print $this->Html->image('/images/en.png',array('alt' => Configure::read('Site.title'),'url'=>array('locale' => 'eng'))); ?>

But no change anything, 

anh in menu home, everytime i lick, it turn to english language.
Please help me to fix it, I search in 2 days, but I cannot find any thing


Nguyễn Trung

unread,
May 18, 2013, 12:15:05 AM5/18/13
to cro...@googlegroups.com
I missed some thing

I file \app\Plugin\Translate\Config\bootstrap.php, I added some things:
Configure::write('Translate.models', array(
'Node' => array(
'fields' => array(
'title' => 'titleTranslation',
'excerpt' => 'excerptTranslation',
'body' => 'bodyTranslation',
),
'translateModel' => 'Nodes.Node',
),
'Block' => array(
'fields' => array(
'title' => 'titleTranslation',
'body' => 'bodyTranslation',
),
'translateModel' => 'Blocks.Block',
),
'Link' => array(
'fields' => array(
'title' => 'titleTranslation',
'description' => 'descriptionTranslation',
),
'translateModel' => 'Menus.Link',
),
// I ADDED HERE
'Contact' => array(
'fields' => array(
'title' => 'titleTranslation',
'body' => 'bodyTranslation',
'name' => 'nameTranslation',
),
'translateModel' => 'Contacts.Message',
),
));
Reply all
Reply to author
Forward
0 new messages