alias display when translating product

  • Posts: 290
  • Thank you received: 22
2 years 3 months ago #343834

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0

Hi,
I noticed that when updating a name of a product in a different language using the HikaShop country flags that the alias of that is exactly the product name with capitals, spaces etc.

This is different than what I expect (all small with - in between).

I have the support of translated aliasses set to ON.

Now I'm wondering if this is by design, a bug, something I did wrong or different?

Thanks for your reply.

Last edit: 2 years 3 months ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
2 years 3 months ago #343849

Hi,

It is not by design. It's a byproduct of how you translate your products and how HikaShop's internal translation system works:
When you use the translation popup to enter a translation for a text, the system will take the original text from the product, uppercase it, remove non-latin letters and use it as a translation key to add a translation override for your text.
So for example, if you have a product with the name "HikaShop English" and you enter the text "HikaShop Français" in the translation popup for the name, HikaShop will add a translation override:
HIKASHOPENGLISH="HikaShop Français"
Now, if the original alias of the product is "hikashop-english", when HikaShop's translation system looks for its translation text, it will look for that same translation key "HIKASHOPENGLISH". And so it will use "HikaShop Français" as the alias of the french version of the product.
To avoid that, you can enter translation key you want in the alias of the product. So instead of "hikashop-english", you could enter for example MY_HIKASHOP_ALIAS
Then, in the English translation popup, you can enter "hikashop-english" and in the french one, you can enter "hikashop-francais".

Now having spaces and accents in aliases is not necessarily a problem. It was 20 years ago and maybe 10 years ago, but now all browsers and search crawlers support UTF8 letters in URLs. So the alias is less useful than it was before and you could just not bother with all this.

Finaly, note that this supposes that the option "Non-latin translation keys" is turned off under the Languages tab of the HikaShop configuration. With that option activated, the system will use a hash instead of upper casing letters and removing non latin characters to generate the translation key. In that case, the alias issue shouldn't be one unless the text of the product name and the alias are exactly the same in the original language but in that case having the translated name and alias being the same too shouldn't be a problem either. Note however that if you already translated your content without that option activated, when you activate it, you'll have to redo your translations so this would only be useful for new shops.

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

  • Posts: 290
  • Thank you received: 22
2 years 3 months ago #343876

Hi Nicolas,
Thanks for the great explanation.

I've been using parts of your tips already but the alias made me question this, probably because I was used to aliases having all small caps etc :)

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

Time to create page: 0.059 seconds
Powered by Kunena Forum