Post by xaicks » Fri Sep 21, 2007 11:40 am

hi ppl!!!

how can i define variables for languages translate!!!
E.g. i want to add some text´s in product area, and when i click in the flag it translates

Sorry i think that is very easy, but i don´t find it!!!

Thanks

Newbie

Posts

Joined
Thu Sep 13, 2007 9:32 am

Post by nde » Fri Sep 21, 2007 7:00 pm

You add languages to the catalog/language/ folder. Then, in the admin, you need to add these languages via Admin > Config > Localization > Languages.

Then you're able to add different languages when adding/editing products.

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by xaicks » Fri Sep 21, 2007 9:39 pm

i dont want to add languages, but words in my site, it´s simple to add text but i want translate this words when i click in the flag!!

Thanks

Newbie

Posts

Joined
Thu Sep 13, 2007 9:32 am

Post by nde » Sat Sep 22, 2007 2:11 am

Ok, I got you wrong there. Don't know how to add words that will translate outside the product description, etc...
Maybe you can start looking how things like box headers etc. are handled right now.

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by luvz2drv » Sat Sep 22, 2007 4:32 am

make a copy of the english one..
change the words you want
when they click the flag it will switch out the words


the LANGUAGE files are the control for that...

luvz2drv


Post by d77 » Sat Sep 22, 2007 11:38 pm

it sounds like you need multiple language support, which opencart provides, however to support multiple languages you need to create the language package, as well as enter all your product data in multiple languages.

i have worked with similar features on another project where its not a full language replacement, but more of an individual word replacement using one language. however, i don't quite get how this would apply in a shop.

if you need something other than multiple language support, can you supply a specific example that applies to your business so we can understand the requirement a bit better?

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by nde » Sun Sep 23, 2007 12:56 am

No I think he needs to add more words that translate 'out of the box'. Some that are not in the language files and not needed for Opencart.

xaicks:
Look at a language php file and see how different words are defined.
These get read from within the backend in this form:

Code: Select all

$language->get('button_add_to_cart'));
So if you define your own variable in the language files they should be available in any template file:

Code: Select all

<?php echo $language->get('my_own_variable')) ?>
PS: not tested that yet though!

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by xaicks » Tue Sep 25, 2007 8:29 am

Hi,

In language/portuguese/controller/product.tpl i have this


In template/default/content/product.tpl i want to put the variable and the result is this notice
Notice: Undefined variable: text_descr in /hermes/web10/b1117/pow.lusotekops16/htdocs/pakiee/catalog/template/default/content/product.tpl on line 26
how can i define variables?
Thanks ppl!

Newbie

Posts

Joined
Thu Sep 13, 2007 9:32 am

Post by luvz2drv » Tue Sep 25, 2007 1:24 pm

you need to set it to the template...

part one of what you have done is good... :)

now part 2

file you need to edit

/catalog/controller/product.php          load('controller/product.php');

add this...

$view->set('text_descr', $language->get('text_descr'));


save and you should be good to go

luvz2drv


Post by xaicks » Wed Sep 26, 2007 8:32 am

yeah!!

Thanks Ppl!!  ;D

Newbie

Posts

Joined
Thu Sep 13, 2007 9:32 am
Who is online

Users browsing this forum: No registered users and 6 guests