Display message is not translated.

  • Posts: 2
  • Thank you received: 0
11 years 1 month ago #166077

Hi,
My site is in german language. Everything is going perfect. But in the product display message of item in stock is not displaying in german. Message is displaying in english.

Last edit: 11 years 1 month ago by roy.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #166082

Hi,

Thanks to check in the language file if the entry is present, and if it is in german.
You can see that via HikaShop Configuration > Languages.

If the entry is not present, you can add it in the override part.
hikashop.com/support/faq.html#tran

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166235

I also has this confusion.
For English version:X_ITEMS_IN_STOCK="%s items in stock"
It still show "%s items in stock" on page even I had added override "X_ITEMS_IN_STOCK="""

For Chinese version. Translation and override didn't work also. Just show English.

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166239

Turn on the debug mode and debug languages options of the Joomla configuration and look at the page with the issue again. It will give you at the bottom a recap of the problems with your translation files so that you can check the lines incriminated for the error.

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166279

Many thanks for your support:
I opened a page and debug language. error showed as follow:

"JROOT/language/zh-CN/zh-CN.com_hikashop.ini :error line 2108, 2110
JROOT/language/en-GB/en-GB.mod_falang.ini :error line 21 "

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166295

Then check around those lines of these files via FTP and you should find the issue.
If you don't know, please copy the lines around these places here so that we can tell you.

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166321

Thanks! But sorry I didn't know the codes.
So attached.

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166361

We didn't get your attachments.
Could you maybe paste them on pastebin.com/ and give us a link to them once done ?

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166389

OK!
pastebin.com/hF8cqBFG (zh-CN.com_hikashop)
pastebin.com/RsTvCGUD (en-GB.mod_falang)

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166395

Hi,

In the hikashop language file, you have the text:

COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator,
 
A new user '%s', username '%s', has registered at %s."
while if you look at the same file we have on our website ( www.hikashop.com/download/languages.html ) the line is:
COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator,\r\n\r\nA new user '%s', username '%s', has registered at %s."
Do the change in your language file and it should be better :)

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166600

Thanks!
I changed that language,and now no error tips in language debug!
But still " items in stock" was not translated in CN page

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166624

Change the line:
$text = JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity);
to:
$text = JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity);
in the file "quantity" of the view "product" via the menu Display>Views and try again.

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

  • Posts: 94
  • Thank you received: 3
11 years 1 month ago #166852

Thanks!
I amended the code and saved,but then it would change to original code again.

if(JText::_('X_ITEM_IN_STOCK')=='X_ITEM_IN_STOCK'){
$text = JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity);
}else{
$text = JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity);
}
}else{
$text = JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity);
}
echo '<span class="hikashop_product_stock_count">'.$text.'<br/></span>';
if($config->get('button_style','normal')=='css'){
echo '<br />';
}

In translation file, the code is:
X_ITEMS_IN_STOCK="库存:%s 件"

So I wonder if Item is right or Items is right?

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166862

Both translations exist in order to handle the difference between the singular and the plural.

In your translation file you have both X_ITEM_IN_STOCK and X_ITEMS_IN_STOCK but you only have X_ITEMS_IN_STOCK translated. That's why you still see the english when it's X_ITEM_IN_STOCK which is used as it is not translated in chinese on your website. Translate it and you won't get the english in any case.

The following user(s) said Thank You: bluetooth

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

  • Posts: 94
  • Thank you received: 3
11 years 4 weeks ago #167019

Yes! I added X_ITEM_IN_STOCK translation,then problem solved!
Thank you very much!

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

Time to create page: 0.101 seconds
Powered by Kunena Forum