How to use language strings into Components?

Started by Razva, March 09, 2017, 06:52:39 AM

Razva

Hey,

I would like to use the "ips" translation string into a product Component.

The translation string is already in the "clientarea" language section (including Admin), but it seems that using {$lang.ips} doesn't works.

Any hints?

Thank you!

hbillclient

Hi,

Do this:

Go to Components section and select the specific field and enter the keyword for the translation in the field name like {$lang.<keyword>}:

For Eg:

Select RAM field and in the "Basic settings", clear the existing text in the "Field name" and enter {$lang.ram} in its place and "Save Changes".

That should do.

Be sure to define all language translations that you wish to use, for the specific keyword.

Hope that helps.

Razva

That's exactly what I've done.

Step 1: find the string that I want to use: https://www.screencast.com/t/6i91vVDg
Step 2: use that string in the Components -> Filed name: https://www.screencast.com/t/K9ptEnozOuvI
Step 3: verify the result: https://www.screencast.com/t/hIuooIslm

It doesn't works.  Really! :-\

hbillclient

Hi,

Create the translation in the "cart" or "global" section and that should work.

Thanks.

Razva

So basically everything outside "cart" or "global" is ignored? I was also looking into creating a "Custom section" and inserting translations into it, so I don't lose it when importing/exporting stuff (and it looks more logical). But it seems out of discussion, as only  "cart" and "global" are parsed?

Any way to workaround this?

hbillclient

Since the components are a part of the shopping cart it does make sense to have the translation within 'cart' section or where it is globally available using the  'global' section.

You can either make the translations and then export it to a file for safe keeping or you can take a backup of the translation data from the database by filtering on language field.

The following tables store the respective translations:

       hb_language_locales(can filter by both language and keyword)
       hb_email_templates

If you are having to do multiple language translations then you might find 'translation tags' useful. These tags can be created for all elements having a "Add translation" link and when you click on the link, it automatically creates keyword with 'customline001' and so on and you can enter translations for all enabled language in one go.

Hope this helps.

Razva

Thank you for all the details, I *really* appreciate your support!

The last question in this subject would be: is there any way to have a custom Section globally available, similar with "global" and "cart"?