Skip to main content

the translation of plugin

11 years 5 months ago #202125 by likunzhou
-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5.9

Hi~
I've allowed our vendors could set thire own payment and shipping plugin. However, not all of our vendors know English well. How can I translate those names of these plugin?
Thank you~



Please Log in or Create an account to join the conversation.

11 years 5 months ago - 11 years 5 months ago #202160 by Jerome
Replied by Jerome on topic the translation of plugin
Hi,

In the view "pluginmarket | add", please replace
Code:
echo $row->name;
Into
Code:
$translation_key = 'PLG_HIKASHOP'.strtoupper($this->plugin_type).'_'.strtoupper($row->element); if($translation_key != JText::_($translation_key)) echo JText::_($translation_key); else echo $row->name;
It will allow you to translate the plugin names by creating translations like
Code:
PLG_HIKASHOPSHIPPING_MANUAL="Manual shipping" PLG_HIKASHOPSHIPPING_UPS="UPS shipping" PLG_HIKASHOPPAYMENT_BANKTRANSFER="Bank transfer"

We will add that patch in the next HikaMarket release.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 11 years 5 months ago by Jerome. Reason: fix

Please Log in or Create an account to join the conversation.

11 years 5 months ago #202181 by likunzhou
Replied by likunzhou on topic the translation of plugin
Hi

thank you for your response, However, I do not know coding very much
Could you tell me which file should I edit and the translations should be added in zh-CN.com_hikamarket.ini right?

BTW, when will the next HikaMarket release?

Please Log in or Create an account to join the conversation.

11 years 5 months ago #202186 by Jerome
Replied by Jerome on topic the translation of plugin
Hi,

Like I wrote in my previous message, the view is the view "pluginmarket | add".
To edit a view, please see:
* www.hikashop.com/support/support/documen...-display.html#layout
* www.hikashop.com/support/documentation/i...op-view-listing.html
* www.hikashop.com/support/documentation/i...ashop-view-form.html

Thanks for the view editor in HikaShop, you will be able to edit the HikaMarket view and replace the line I gave by the 5 lines.

Once you have override the view, you will be able to add your translations overrides.
See: www.hikashop.com/download/languages.html#modify
In the HikaShop (and HikaMarket) configuration, you can manage the languages and you have a special zone where you can add your translation overrides.

About the new HikaMarket release my goal is to publish it end of this week.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 5 months ago #202247 by likunzhou
Replied by likunzhou on topic the translation of plugin
Hi

I've followed what you said, however, the language can not display
I added these code both in hikashop and market language files in the configuration
Code:
PLG_HIKASHOPSHIPPING_AUSTRALIAPOST="澳洲邮政" PLG_HIKASHOPSHIPPING_CANADAPOST="加拿大邮政" PLG_HIKASHOPSHIPPING_CANPAR="CANPAR" PLG_HIKASHOPSHIPPING_ENVOIMOINSCHER="EnvoiMoinsCher" PLG_HIKASHOPSHIPPING_FEDEX=" Fedex联邦快递" PLG_HIKASHOPSHIPPING_MANUAL="UPS" PLG_HIKASHOPSHIPPING_UPS="USPS" PLG_HIKASHOPSHIPPING_USPS="其他快递邮寄"

however, It displays this in front

Please Log in or Create an account to join the conversation.

11 years 5 months ago #202283 by Jerome
Replied by Jerome on topic the translation of plugin
Hi,

My fault !
I fixed the code in my previous post to replace the line
Code:
echo $translation_key;
By
Code:
echo JText::_($translation_key);

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 5 months ago #202373 by likunzhou
Replied by likunzhou on topic the translation of plugin
Hi
It runs well now
Thank you~

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.061 seconds
Powered by Kunena Forum