v4.0.2 - still wrong aliases from russian words

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #130862

-- 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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 weeks ago #130963

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):

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.

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131015

here is the solve for russian language

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: 11 years 2 weeks ago by progreccor.
The following user(s) said Thank You: Xavier

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

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131016

I will search for the international support and write it here later


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

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

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

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131047

I think that here is the solve for the problem

$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: 11 years 2 weeks ago by progreccor.

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

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131054

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 weeks ago #131524

Hi,

Ok, I see what you mean.
Can you try to change the code:

if(is_string($old)) {
				$old = JFactory::getLanguage($old);
			}
to:
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.

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131580

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.

  • Posts: 2293
  • Thank you received: 315
11 years 2 weeks ago #131581

I have traced your constructor code and see one strange thing
language at this moment is English! O_O


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

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

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 weeks ago #131590

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.

  • Posts: 2293
  • Thank you received: 315
11 years 1 week ago #131649

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

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
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: 11 years 1 week ago by progreccor.

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

  • Posts: 2293
  • Thank you received: 315
11 years 1 week ago #131650

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.

  • Posts: 2293
  • Thank you received: 315
11 years 1 week ago #131653

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

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 1 week ago #131657

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.

  • Posts: 105
  • Thank you received: 1
10 years 11 months ago #135863

Hika 2.2.3 Joomla 3.2
Still does not working!

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

  • Posts: 2293
  • Thank you received: 315
10 years 11 months ago #135934

I have tested last version. For me it's working ok.


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

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

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 11 months ago #135943

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.099 seconds
Powered by Kunena Forum