| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
#1
|
|||||||
|
|||||||
Translation
Hi,
Does anyone try to add the translation for modified modules? Like I have a title and I try to use the translation from admin end but it doesn't work. I have 2 languages in my store EN and AR. Does anyone try this? Thanks!
__________________
Multi-vendor 5.3.6.0 |
|||||||
#2
|
|||||||
|
|||||||
Re: Translation
Are you talking about your own modules, or ready-made ones? Il the latter, which one?
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#3
|
|||||||
|
|||||||
Re: Translation
Hi ed,
My store has a 2 languages which is En and AR. We made a customize module which is for vendor listing and I would like also to translate it from EN to AR when a user try to use AR. I tried to use the translation in the admin but it doesn't work. Is there any code to able to work the translation? Thank you so much
__________________
Multi-vendor 5.3.6.0 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Translation
Your custom module must be coded to support multiple languages. Any text label that you may want to translate should be outputted with the t method
t('text') - in twig files static::t('text') - in php files If you have models with text fields which needs to be translated you need to split the model to 2 classes to use languages - you can look how this is done for Product model for example - Product.php and ProductTranslations.php
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
Re: Translation
Quote:
See also https://devs.x-cart.com/basics/creating-mutlilanguage-entity.html for more on this.
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
|
|||
X-Cart forums © 2001-2020
|