News:

Support the VirtueMart project and become a member

Main Menu

I can't find the language string for translation

Started by funny-rabbit, October 15, 2020, 15:07:22 PM

Previous topic - Next topic

funny-rabbit

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

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

Yes .. searching for parts of the string .. e.g. 'try different' is very good advice
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

funny-rabbit

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

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

#5
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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

jjk

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

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

funny-rabbit

#8
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

Quoteso 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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

funny-rabbit

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

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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

GJC Web Design

@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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jjk

#13
pinochico and GJC replied while I was typing this. but maybe I can clarify the procedure a little bit further...  :)

At present 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:
return vmText::_('COM_VM_COUPON_MAX_LIMIT_REACHED');

and afterwards add
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
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