Skip to main content

v4.0.2 - still wrong aliases from russian words

More
12 years 10 months ago #130862 by progreccor
-- HikaShop version -- : 2.2.0
-- Joomla version -- : 3.0
- PHP version -- : 5.3.0
-- Browser(s) name and version -- : ALL

If we use hikashop on russian language there is no option to translitarate russian names of goods to english.

the solve for this problem like here

файла \administrator\components\com_jshopping\controllers\products.php чтобы получилость так:

if ($jshopConfig->create_alias_product_category_auto && $post=="") $post = JApplication::stringURLSafe($post);

We know that on the hikashop joomshopping it's ok

please update hikashop business

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

More
12 years 10 months ago #130963 by nicolas
It's definitely not that code which would allow you to do that.
HikaShop already uses that code (file administrator/components/com_hikashop/classes/product.php):
Code:
function addAlias(&$element){ if(empty($element->product_alias)){ $element->alias = $element->product_name; }else{ $element->alias = $element->product_alias; } $app = JFactory::getApplication(); if(method_exists($app,'stringURLSafe')){ $element->alias = $app->stringURLSafe(strip_tags($element->alias)); }else{ $element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias)); } }
It's actually used to handle UTF8 characters in URLs, not to transliterate Russian names.
If you have an example of code, we can potentially add an option, but it's definitely not that code.

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

More
12 years 10 months ago - 12 years 10 months ago #131015 by progreccor
here is the solve for russian language
Code:
function addAlias(&$element){ if(empty($element->product_alias)){ $element->alias = $element->product_name; }else{ $element->alias = $element->product_alias; } $element->alias=ru_RULocalise::transliterate($element->alias); $app = JFactory::getApplication(); if(method_exists($app,'stringURLSafe')){ $element->alias = $app->stringURLSafe(strip_tags($element->alias)); }else{ $element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias)); }

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 12 years 10 months ago by progreccor.
The following user(s) said Thank You: Xavier

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

More
12 years 10 months ago - 12 years 10 months ago #131016 by progreccor
I will search for the international support and write it here later

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 12 years 10 months ago by progreccor.

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

More
12 years 10 months ago - 12 years 10 months ago #131047 by progreccor
I think that here is the solve for the problem
Code:
$lang = JFactory::getLanguage(); $element->alias = $lang->transliterate($element->alias);

but something wrong in your code because transliterator at this point is null...

I'll try to find the problem but if you know it please help

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 12 years 10 months ago by progreccor.

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

More
12 years 10 months ago #131054 by progreccor
I see that you redeclare standart Jlanguage object and may be broke standart transliterate method.

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

More
12 years 10 months ago #131524 by nicolas
Hi,

Ok, I see what you mean.
Can you try to change the code:
Code:
if(is_string($old)) { $old = JFactory::getLanguage($old); }
to:
Code:
if(is_string($old)) { parent::__construct($old); $old = JFactory::getLanguage($old); }else{ parent::__construct(); }
in the file administrator/components/com_hikashop/helpers/helper.php and see if that helps ?
That will initialize the JLanguage object in the same way as the default class and that should hopefully make it use the translatiteration system of your language if any.

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

More
12 years 10 months ago #131580 by progreccor
this is not help.
At the moment when I try to transliterate with standart joomla method JLanguage must have transliterator data.
I try to trace your code and at this moment there is no transliterator data.

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

More
12 years 10 months ago - 12 years 10 months ago #131581 by progreccor
I have traced your constructor code and see one strange thing
language at this moment is English! O_O


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 12 years 10 months ago by progreccor.

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

More
12 years 10 months ago #131590 by nicolas
Ok, change the line:
parent::__construct();

to:
parent::__construct($old->lang);

in the helper.php file and it will work.

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

More
12 years 10 months ago - 12 years 10 months ago #131649 by progreccor
Great!
It is really working!
This is was big problem for Russian and Ukrainian customers. And it was solved!

So I will repeat the steps that needed to be changed.
first in (file administrator/components/com_hikashop/classes/product.php):

the function must be
Code:
function addAlias(&$element){ if(empty($element->product_alias)){ $element->alias = $element->product_name; }else{ $element->alias = $element->product_alias; } $lang = JFactory::getLanguage(); $element->alias = $lang->transliterate($element->alias); $app = JFactory::getApplication(); if(method_exists($app,'stringURLSafe')){ $element->alias = $app->stringURLSafe(strip_tags($element->alias)); }else{ $element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias)); } }

and in (administrator/components/com_hikashop/helpers/helper.php) file
constructor must be
Code:
function __construct($old = null) { if(is_string($old)) { parent::__construct($old); $old = JFactory::getLanguage($old); } else{ parent::__construct($old->lang); } if(is_object($old)) { $this->strings = $old->strings; $this->override = $old->override; $this->paths = $old->paths; $this->metadata = $old->metadata; $this->locale = $old->locale; $this->lang = $old->lang; $this->default = $old->default; $this->debug = $old->debug; $this->orphans = $old->orphans; } }

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 12 years 10 months ago by progreccor.

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

More
12 years 10 months ago #131650 by progreccor
So, Nicolas, could you change the code of Hikashop to include this changes?
It will be helpful for customers of all around the world!

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

More
12 years 10 months ago #131653 by progreccor
AFter some testing I see one thing - we need to change function in administrator\components\com_hikashop\classes\product.php
like here
because of some users can use "unicodeslugs" flag in configuration

so the final code is here
Code:
function addAlias(&$element){ if(empty($element->product_alias)){ $element->alias = $element->product_name; }else{ $element->alias = $element->product_alias; } $config = JFactory::getConfig(); if (! $config->get('unicodeslugs')) { $lang = JFactory::getLanguage(); $element->alias = $lang->transliterate($element->alias); } $app = JFactory::getApplication(); if(method_exists($app,'stringURLSafe')){ $element->alias = $app->stringURLSafe(strip_tags($element->alias)); }else{ $element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias)); } }

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
The following user(s) said Thank You: nicolas

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

More
12 years 10 months ago #131657 by nicolas
Yes, we'll include these modifications for next release.
The following user(s) said Thank You: progreccor

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

More
12 years 9 months ago #135863 by moneymr
Hika 2.2.3 Joomla 3.2
Still does not working!

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

More
12 years 9 months ago #135934 by progreccor
I have tested last version. For me it's working ok.

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

More
12 years 9 months ago #135943 by nicolas
Yes, the modification has been tested and included on our end.
Thank you for confirming that it works on your end too.

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

Time to create page: 0.331 seconds
Powered by Kunena Forum