- Posts: 43
- Thank you received: 0
FaLang translation of custom order statuses
11 years 1 month ago - 11 years 1 month ago #214932
by DavidThor
FaLang translation of custom order statuses was created by DavidThor
-- HikaShop version -- : 2.5.0
-- HikaMarket version -- : 1.6.5
-- Joomla version -- : 3.4.4
Hi,
I'm having an issue with translation of custom order statuses with HikaMarket. I've had feedback from Faboba saying that the issue may be on the HikaShop end how the list is compiled (as a query). All order statuses correctly translated, but custom order statuses don't appear right.
Ideas?
Thanks,
David
-- HikaMarket version -- : 1.6.5
-- Joomla version -- : 3.4.4
Hi,
I'm having an issue with translation of custom order statuses with HikaMarket. I've had feedback from Faboba saying that the issue may be on the HikaShop end how the list is compiled (as a query). All order statuses correctly translated, but custom order statuses don't appear right.
Ideas?
Thanks,
David
Last edit: 11 years 1 month ago by Jerome. Reason: remove private content
Please Log in or Create an account to join the conversation.
11 years 1 month ago #214951
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic FaLang translation of custom order statuses
Hi,
HikaMarket use HikaShop to get the list of the order statuses.
In the view "ordermarket | status", it use the type "order_status".
That type load the statuses from the database with the translations
If the order status does not have any translation in Falang (or Joomfish), HikaMarket will use the Joomla translation system to translate them.
Regards,
HikaMarket use HikaShop to get the list of the order statuses.
In the view "ordermarket | status", it use the type "order_status".
That type load the statuses from the database with the translations
Code:
protected function load() {
$categoryClass = hikamarket::get('shop.class.category');
$filters = array();
$rows = $categoryClass->loadAllWithTrans('status', false, $filters);
foreach($rows as $row) {
if(!empty($row->translation)) {
$this->values[] = JHTML::_('select.option', $row->category_name, hikamarket::orderStatus($row->translation));
} else {
$this->values[] = JHTML::_('select.option', $row->category_name, hikamarket::orderStatus($row->category_name));
}
}
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 1 month ago #215045
by DavidThor
Replied by DavidThor on topic FaLang translation of custom order statuses
HI,
It doesn't add up. Displaying, changing, and saving order statuses behaves differently for.
1 Vendor front-end.
2 Administrator back-end in list view.
2 Administrator back-end in specific order view.
It seams that the definition in the language file is used in the first instance, which then becomes properly translated for standard order statuses that are defined in the language file, and secondly the base non-translated definition from HikaShop > System > Order statuses for other order statuses.
There is also a difference between what the drop-down displays and what value is actually saved.
Regards,
It doesn't add up. Displaying, changing, and saving order statuses behaves differently for.
1 Vendor front-end.
2 Administrator back-end in list view.
2 Administrator back-end in specific order view.
It seams that the definition in the language file is used in the first instance, which then becomes properly translated for standard order statuses that are defined in the language file, and secondly the base non-translated definition from HikaShop > System > Order statuses for other order statuses.
There is also a difference between what the drop-down displays and what value is actually saved.
Regards,
Please Log in or Create an account to join the conversation.
11 years 1 month ago #215084
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic FaLang translation of custom order statuses
Hi,
Please provide details and examples.
Something concrete which can be understand and analyze.
Regards,
Please provide details and examples.
Something concrete which can be understand and analyze.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 1 month ago #215220
by DavidThor
Replied by DavidThor on topic FaLang translation of custom order statuses
Hi,
All order statuses translated with FaLang. Img 1.
1. Vendor front-end changing order status mixes languages. Img 2. Looks to be a mix of system language for default order statuses and FaLang non-translated language for non-default order statuses.
2. Admiinstrator back-end order list view displays correct order statuses in drop-down (img 3) and saves in correct language when selected (img 4). However, if the order status was non-default, the non-translated order status is specified in order view (img 5).
3. Administrator back-end order view displays correct order statuses in drop-down (img 6), but reverts to non-translated value when the order is saved if a non-default order status is selected (img 7).
Hope that explains.
Regards,
David
All order statuses translated with FaLang. Img 1.
1. Vendor front-end changing order status mixes languages. Img 2. Looks to be a mix of system language for default order statuses and FaLang non-translated language for non-default order statuses.
2. Admiinstrator back-end order list view displays correct order statuses in drop-down (img 3) and saves in correct language when selected (img 4). However, if the order status was non-default, the non-translated order status is specified in order view (img 5).
3. Administrator back-end order view displays correct order statuses in drop-down (img 6), but reverts to non-translated value when the order is saved if a non-default order status is selected (img 7).
Hope that explains.
Regards,
David
Please Log in or Create an account to join the conversation.
11 years 1 month ago #215228
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic FaLang translation of custom order statuses
Hi,
Looks like the function "loadAllWithTrans" is using the User default language stored in his profile.
So in the HikaShop category class you can replace:
By
And change the definition of the function to add a new parameter
The, in HikaMarket, you have to give the current locale to the function
By
And it should logically fix the issue.
Regards,
Looks like the function "loadAllWithTrans" is using the User default language stored in his profile.
So in the HikaShop category class you can replace:
Code:
$user = JFactory::getUser();
$locale = $user->getParam('language');
if(empty($locale)){
$config = JFactory::getConfig();
if(!HIKASHOP_J16){
$locale = $config->getValue('config.language');
} else {
$locale = $config->get('language');
if($locale === null)
$locale = $config->get('config.language');
}
}
Code:
if(empty($locale)) {
$user = JFactory::getUser();
$locale = $user->getParam('language');
}
if(empty($locale)){
$config = JFactory::getConfig();
if(!HIKASHOP_J16){
$locale = $config->getValue('config.language');
} else {
$locale = $config->get('language');
if($locale === null)
$locale = $config->get('config.language');
}
}
Code:
function loadAllWithTrans($type = '', $all = false, $filters = array(), $order = ' ORDER BY category_ordering ASC', $start = 0, $value = 500, $category_image = false, $locale = null) {
The, in HikaMarket, you have to give the current locale to the function
Code:
$rows = $categoryClass->loadAllWithTrans('status', false, $filters);
Code:
$locale = null;
$app = JFactory::getApplication();
if(!$app->isAdmin()) {
$lang = JFactory::getLanguage();
$locale = $lang->getTag();
}
$rows = $categoryClass->loadAllWithTrans('status', false, $filters, ' ORDER BY category_ordering ASC', 0, 500, false, $locale);
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.100 seconds