Jump to content

Translation of the /mo abbreviation in the product display page


tanchev

Recommended Posts

Hello Guys,

This is the first time I write here in this community, mostly because brian has answered to a lot of questions and there is almost no reason to ask anything because almost every question already has an answer. I am faced with a problem to which I was not able to find a solution no matter how much I tried and read over the topics in the community. The problem is that I need to translate the /mo abbreviation in the product display template file, unfortunately I was not able to do it by editing the $_LANG function in my lang file because it seems like it is coming directly from the function called {$product.displayPriceSimple} in the tpl file.  Now the problem with that is I guess this function is coming from the cart.php file which is encrypted with Ioncube and so I am not able to touch anything there. 

For those who still don`t understand what I am asking, /mo abbreviation is the abbreviation that WHMCS uses when price for a month is displayed in the product template file. I need it translate it, so please if anyone has been trough that himself and wants to help me out, please write to me and tell me how to do this the correct way.

Thanks,

moChange.png

Link to comment
Share on other sites

On 02/12/2020 at 11:17, tanchev said:

The problem is that I need to translate the /mo abbreviation in the product display template file, unfortunately I was not able to do it by editing the $_LANG function in my lang file because it seems like it is coming directly from the function called {$product.displayPriceSimple} in the tpl file. 

you should be able to translate it by using Language Overrides on the first of the lines below...

$_LANG['shoppingCartProductPerMonth'] = "<span>:price</span>/:countmo";
$_LANG['shoppingCartProductPerYear'] = "<span>:price</span>/:countyr";

and changing the mo at the end to whatever the abbreviation should be for month (or year) in that particular language...

additionally, I should also mention that many of the MarketConnect sales pages use the strings below - so if you're reselling MC products (Weebly etc), then you may have to create overrides for these too.

$_LANG['pricingCycleShort']['monthly'] = "mo";
$_LANG['pricingCycleShort']['quarterly'] = "3mo";
$_LANG['pricingCycleShort']['semiannually'] = "6mo";
$_LANG['pricingCycleShort']['annually'] = "yr";
$_LANG['pricingCycleShort']['biennially'] = "2yrs";
$_LANG['pricingCycleShort']['triennially'] = "3yrs";
$_LANG['pricingCycleLong']['monthly'] = "1 Month";
$_LANG['pricingCycleLong']['quarterly'] = "3 Months";
$_LANG['pricingCycleLong']['semiannually'] = "6 Months";
$_LANG['pricingCycleLong']['annually'] = "1 Year";
$_LANG['pricingCycleLong']['biennially'] = "2 Years";
$_LANG['pricingCycleLong']['triennially'] = "3 Years";

I wouldn't rule out there being hardcoded use of /mo in the code, but that seems to happen less now that it once did.

Link to comment
Share on other sites

1 hour ago, brian! said:

you should be able to translate it by using Language Overrides on the first of the lines below...


$_LANG['shoppingCartProductPerMonth'] = "<span>:price</span>/:countmo";
$_LANG['shoppingCartProductPerYear'] = "<span>:price</span>/:countyr";

and changing the mo at the end to whatever the abbreviation should be for month (or year) in that particular language...

additionally, I should also mention that many of the MarketConnect sales pages use the strings below - so if you're reselling MC products (Weebly etc), then you may have to create overrides for these too.


$_LANG['pricingCycleShort']['monthly'] = "mo";
$_LANG['pricingCycleShort']['quarterly'] = "3mo";
$_LANG['pricingCycleShort']['semiannually'] = "6mo";
$_LANG['pricingCycleShort']['annually'] = "yr";
$_LANG['pricingCycleShort']['biennially'] = "2yrs";
$_LANG['pricingCycleShort']['triennially'] = "3yrs";
$_LANG['pricingCycleLong']['monthly'] = "1 Month";
$_LANG['pricingCycleLong']['quarterly'] = "3 Months";
$_LANG['pricingCycleLong']['semiannually'] = "6 Months";
$_LANG['pricingCycleLong']['annually'] = "1 Year";
$_LANG['pricingCycleLong']['biennially'] = "2 Years";
$_LANG['pricingCycleLong']['triennially'] = "3 Years";

I wouldn't rule out there being hardcoded use of /mo in the code, but that seems to happen less now that it once did.

Hello @brian! this fixed my issues, yes.  Thank you very much.

Can you please tell me how were you able to find the $LANG variable`s name inside the template files, because no matter how much I tried to find this variable`s name in order to look for it in the lang file, I was unfortunately not able to. This will definitely save me a lot of time in the future.

Thanks,

Regards,

Link to comment
Share on other sites

  • 2 weeks later...
On 03/12/2020 at 13:38, tanchev said:

Can you please tell me how were you able to find the $LANG variable`s name inside the template files, because no matter how much I tried to find this variable`s name in order to look for it in the lang file, I was unfortunately not able to. This will definitely save me a lot of time in the future.

I suspect it's because i've answered the question before and so remembered where to look. 🙂

additionally, these strings are sometimes used internally in the PHP code (e.g in pricing strings) - so if there are multiple string options that might be being used, often it can be useful to change each of them slightly so that you can tell which string is being used... this is particularly effective when there are multiple strings with the same text and you need to determine which one is being used in a particular instance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated