Author Topic: I can't find the language string for translation  (Read 751 times)

funny-rabbit

  • Beginner
  • *
  • Posts: 21
I can't find the language string for translation
« on: October 15, 2020, 15:07:22 pm »
In Virtuemart I have a language string that I want to translate into the German language.
The language string is "Maximum coupon usage limit reached, please try different code."

I have searched all joomla and virtuemart files with notepad++ with "search inside files" but notepad++ doesn't find that expression.
Next I searched the sql database, the expression isn't there either.

How can I find and translate that expression?
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3136
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: I can't find the language string for translation
« Reply #1 on: October 15, 2020, 15:23:26 pm »
You have not searched all files. I guess You are using Awocoupon. Please search these files.

Have You really searched for the right string ? It could be made up of multiple strings.

You may also search Joomla language manager, visit Joomla forum for instructions to use.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: I can't find the language string for translation
« Reply #2 on: October 15, 2020, 15:30:07 pm »
Yes .. searching for parts of the string .. e.g. 'try different' is very good advice
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

funny-rabbit

  • Beginner
  • *
  • Posts: 21
Re: I can't find the language string for translation
« Reply #3 on: October 15, 2020, 16:08:47 pm »
yeah, I searched the half-part of the expression: nada
that expression also couldn't be found (neither part of it) in the language manager.
what I'm trying to do now, is to only search for the word 'coupon' in the database.
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3136
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: I can't find the language string for translation
« Reply #4 on: October 15, 2020, 16:25:59 pm »
In the language manager?
You said you searched ALL the Joomla and VM files.
What coupons manager are you using?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 809
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: I can't find the language string for translation
« Reply #5 on: October 15, 2020, 19:55:23 pm »
it's funny:

https://www.google.com/search?client=safari&rls=en&q=linux+how+find+text+expression+in+ftp&ie=UTF-8&oe=UTF-8


1. Ask VM DEV why use non-sense hard coded text and don't use Language Constant and ask for repair
2. Change core file VM self and change to override language constant
3. Wait for VM DEV for fix on next version or every upgrade fix self
4. Learn to use develper tools for eshop development (grep, ...) [easygrep is our custom version from grep, developed by EasySoftware]
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: I can't find the language string for translation
« Reply #6 on: October 16, 2020, 16:41:04 pm »
Notepad++ also finds this old (probably forgotten) hard coded string if you set the search filter to 'all' or 'php' files  ;)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 809
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: I can't find the language string for translation
« Reply #7 on: October 16, 2020, 19:25:30 pm »
The Problem is not in method use
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

funny-rabbit

  • Beginner
  • *
  • Posts: 21
Re: I can't find the language string for translation
« Reply #8 on: October 16, 2020, 19:30:21 pm »
the problem is probably witch-craft because see my uploaded image. I don't have activated 'use english for untranslated strings' which to me means, that english isn't even used when a string is not translated in the language manager in another language. and that string definitely belongs to virtuemart. so what's going on here?

in short: virtuemart configuration menu -> use english for untranslated strings is set to 'no'
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 809
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: I can't find the language string for translation
« Reply #9 on: October 16, 2020, 19:38:39 pm »
Quote
so what's going on here?

The problem is this, that your setup "use english for untranslated strings is set to 'no' or 'yes'  doesn't solve your problem, you can't really see it in my picture?
This sentence is not in LANGUAGE CONSTANT then you can't find and use with your actions in post.

The marginal problem is that you only searched in language constants and you can't work when searching for a text string on FTP (one of the basic steps in debugging a problem with program code in the e-shop).
The positive is that now you can do it, thanks to advice.

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

funny-rabbit

  • Beginner
  • *
  • Posts: 21
Re: I can't find the language string for translation
« Reply #10 on: October 16, 2020, 19:53:13 pm »
ok I helped you can you clarify for me now?

https://drive.google.com/file/d/1dsufrYI9Umv_5q9n7VPr7fUrjQ5XSo_s/view?usp=sharing

use english for untranslated strings is set to no, so normally english language values can't appear in the cart view?
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 809
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: I can't find the language string for translation
« Reply #11 on: October 16, 2020, 20:26:51 pm »
In this post we communicate only about "Maximum coupon usage limit reached, please try different code."

This text are not as LANGUAGE CONSTANT, then your sending setup not help to you.
You must make step by step as I wrote there: http://forum.virtuemart.net/index.php?topic=145661.msg517362#msg517362 for fix this problem (but only this).

I think the best is change code from

return 'Maximum coupon usage limit reached, please try different code.';

to

return vmText::_( 'COM_VIRTUEMART_CART_COUPON_CODE_NOVALID' );

But you must test self :)

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: I can't find the language string for translation
« Reply #12 on: October 16, 2020, 20:51:22 pm »
@funny-rabbit

to clarify ..  the text "Maximum coupon usage limit reached, please try different code." is mistakenly HARDCODED in the file helpers/cart.php as a string .. not a lang constant.

So in the short term u need to replace it with a constant of your own  -- I am sure in the next release it will be corrected
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: I can't find the language string for translation
« Reply #13 on: October 16, 2020, 20:58:59 pm »
pinochico and GJC replied while I was typing this. but maybe I can clarify the procedure a little bit further...  :)

At present
Code: [Select]
Maximum coupon usage limit reached, please try different code. is hard-coded in the file ...\components\com_virtuemart\helpers\cart.php. line 1130, which means it is not translatable in the de-DE.com_virtuemart.ini file.

In order to make it translatable, you would have to replace that with something like:
Code: [Select]
return vmText::_('COM_VM_COUPON_MAX_LIMIT_REACHED');
and afterwards add
Code: [Select]
COM_VM_COUPON_MAX_LIMIT_REACHED="Maximum coupon usage limit reached, please try different code."to the frontend en-GB.com_virtuemart.ini file and maybe
Code: [Select]
COM_VM_COUPON_MAX_LIMIT_REACHED="Maximale Coupon-Verwendungsgrenze erreicht, bitte anderen Code ausprobieren.."to the German frontend de- DE.com_virtuemart.ini file.

A similar change will be needed for line 1201 in cart.php

...or wait for the next release of VirtueMart. It should be corrected there. 
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations