Jump to content
wp4all

Marketplace translation

Recommended Posts

Hi,

just try to translate the Market Place Promo Pages which is really horrible .

This post helps a lot thanks to Brian for his work --> https://whmcs.community/topic/272661-marketplace-modules-languages-files/?tab=comments#comment-1245201

Unfortunately, I can't post under the original article therefor I open a new one.

I try to translate this part http://prntscr.com/j1tord

I know I have to start here :

div class="additional-options">
                            {foreach $productOptions as $productKey => $options}
                                <div class="option options-{$productKey}">
                                    {foreach $options as $option}
                                        <label class="checkbox-inline">
                                            <input type="checkbox" name="options" value="{$option.product}">
                                            {$option.description} {lang key="store.emailServices.for"} <span>{lang key="store.emailServices.just"} {$option.pricing->toFullString()} {lang key="store.emailServices.more"}</span>
                                        </label><br>
                                    {foreachelse}
                                        None available
                                    {/foreach}
                                </div>

 

The replace - code is :

{if $LANG.store.emailServices.label.{$XXXXX|replace:' ':''|replace:'.':''|strtolower}}{$LANG.store.emailServices.label.{$XXXXX|replace:' ':''|replace:'.':''|strtolower}}{else}{$XXXXX}{/if}

 

 

My $_LANG string are :

$_LANG['store']['emailServices']['label']['addoutgoingfiltering'] = "Ausgehendes Filtern";
$_LANG['store']['emailServices']['label']['addincomingarchiving'] = "Eingehendes Archivieren";
$_LANG['store']['emailServices']['label']['addoutgoingfiltering&archiving'] = "Ausgehendes Filtern & Archivieren";

I would assume to replace $productKey but the array that needs to be replaced is {$option.description}.

Anybody an idea how i need to go forward ?

 

Thanks and best regards 

Christian

Share this post


Link to post
Share on other sites

Hi Christian,

16 hours ago, wp4all said:

just try to translate the Market Place Promo Pages which is really horrible.

they're a mess.

16 hours ago, wp4all said:

Unfortunately, I can't post under the original article therefore I open a new one.

yeah someone of the moderating staff went mental and starting locking multiple threads from 2017 that should have been left open.... especially when there are threads from years earlier that aren't locked... but ours is not to reason why. 9_9

16 hours ago, wp4all said:

I would assume to replace $productKey but the array that needs to be replaced is {$option.description}.

Anybody an idea how i need to go forward ?

I would suggest the following should work...

{if $LANG.store.emailServices.label.{$option.description|strtolower|replace:' ':''}}
	{lang key="store.emailServices.label.{$option.description|strtolower|replace:' ':''}"}{else}{$option.description}
{/if}

so if a language string exists that equals the description, it will use that - otherwise, it uses the default string...

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Brian,

Thx great, it works fine. But how can I do it when 2 arrays are in a loop ?

                                    <li>{$certificateFeatures.{$product->configoption1}.issuance}</li>
                                    <li>{$certificateFeatures.{$product->configoption1}.for}</li>
                                    <li>USD ${$certificateFeatures.{$product->configoption1}.warranty}</li>

How can they program only such interleaves ?

Hope someone got an idea .

 

Greetings Christian

Share this post


Link to post
Share on other sites
3 hours ago, wp4all said:

Thx great, it works fine. But how can I do it when 2 arrays are in a loop ?

how about this (forgive Google Translate for the German!)...

<li>{if $LANG.store.ssl.issuance.{$product->configoption1}}{lang key="store.ssl.issuance.{$product->configoption1}"}{else}{$certificateFeatures.{$product->configoption1}.issuance}{/if}</li>
<li>{if $LANG.store.ssl.for.{$product->configoption1}}{lang key="store.ssl.for.{$product->configoption1}"}{else}{$certificateFeatures.{$product->configoption1}.for}{/if}</li>
<li>USD ${$certificateFeatures.{$product->configoption1}.warranty}</li>
$_LANG['store']['ssl']['issuance']['rapidssl_rapidssl'] = "Minuten";
$_LANG['store']['ssl']['for']['rapidssl_rapidssl'] = "Persönliche Webseiten";

$_LANG['store']['ssl']['issuance']['geotrust_quicksslpremium'] = "Minuten";
$_LANG['store']['ssl']['for']['geotrust_quicksslpremium'] = "Kleinbetrieb";

and then work your way through the rest of the SSL products that you want to tweak...

7q1NbhW.png

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hi,

so hopefully there are only a few hurdles left .
Sometimes amazing, codes that worked before wont work on other positions oO?

http://prntscr.com/j2izf6

 

            <h3>
                {$promotion->getHeadline()}
            </h3>

replacement:

{if $LANG.replace.{$promotion->getHeadline()|replace:' ':''|replace:'.':''|strtolower}}{$LANG.replace.{$promotion->getHeadline()|replace:' ':''|replace:'.':''|strtolower}}{else}{$promotion->getHeadline()}{/if}

My new text :

$_LANG['replace']['addsecuritytoyouremailandsaygoodbyetospam'] = "My new text";

 

Where can I find also this Term 'mo / yr' is this somewhere in the WHMCS System? --> http://prntscr.com/j2j2pe

I can't find it under system time format do I need to replace it also from :

{$product->pricing()->best()->breakdownPrice()}

The worst is, I know it already at the next update it starts from scratch :-(

Greetings Christian

Share this post


Link to post
Share on other sites

Hi Christian,

22 hours ago, wp4all said:

Sometimes amazing, codes that worked before wont work on other positions oO?

welcome to using WHMCS! :)

the problem you have here is that the $LANG array isn't available to the upsell templates (seemingly confirms that MarketConnect wasn't originally designed with multiple languages in mind - insane!), so that IF statement we used previously will never be true here... if the $LANG array was available, then the previous code would work.... 9_9

so we have to come at this from another angle, create our own arrays and then see if the current headline/tagline matches any of them...

<h3>
	{$validheadlines = array('Add Security to your Email and say goodbye to spam','Protect your website and boost your search rankings with an SSL certificate')}
	{$langheadline = "store.upsell.headline."|cat:($promotion->getHeadline()|replace:' ':''|replace:'.':''|strtolower)}
	{if $promotion->getHeadline()|in_array:$validheadlines}{lang key="$langheadline"}{else}{$promotion->getHeadline()}{/if}
</h3>
<h4>
	{validtaglines = array('With near 100% filtering accuracy and increased email continuity','Included with your SSL certificate')}
	{$langtagline = "store.upsell.tagline."|cat:($promotion->getTagline()|replace:' ':''|replace:'.':''|strtolower)}				
	{if $promotion->getTagline()|in_array:$validtaglines}{lang key="$langtagline"}{else}{$promotion->getTagline()}{/if}
</h4>
$_LANG['store']['upsell']['headline']['addsecuritytoyouremailandsaygoodbyetospam'] = "Fügen Sie Sicherheit zu Ihrer E-Mail hinzu und verabschieden Sie sich von Spam";
$_LANG['store']['upsell']['headline']['protectyourwebsiteandboostyoursearchrankingswithansslcertificate'] = "Schützen Sie Ihre Website und steigern Sie Ihre Suchergebnisse mit einem SSL-Zertifikat";

$_LANG['store']['upsell']['tagline']['withnear100%filteringaccuracyandincreasedemailcontinuity'] = "Mit nahezu 100% Filtergenauigkeit und erhöhter E-Mail-Kontinuität";
$_LANG['store']['upsell']['tagline']['includedwithyoursslcertificate'] = "Im Lieferumfang Ihres SSL-Zertifikats enthalten";

qK710Vp.png

however, unlike previous changes, you're going to have to add these language strings for ALL languages (even if they're just copies of the default English values) because we cannot check if the language string exists... if you set the language to one that doesn't have these language strings, you'll see this...

pF9XjgC.png

so it's important to add the strings to all languages... and check they haven't changed, or new ones added, after updating WHMCS.

22 hours ago, wp4all said:

Where can I find also this Term 'mo / yr' is this somewhere in the WHMCS System?

I think they're added by the Price Formatter class, and are probably just using English abbreviations... there's nothing in the language files or class documentation I can see to change this...

you could treat them as normal variables and just replace the /mo and /yr strings with other strings or language overrides - but again, these would need to be added for all available languages.

{$product->pricing()->best()->breakdownPrice()|replace:'/mo':{lang key="store.upsell.monthly"}|replace:'/yr':{lang key="store.upsell.yearly"}}{/if}
$_LANG['store']['upsell']['monthly'] = "/mtl.";
$_LANG['store']['upsell']['yearly'] = "/jhrl.";

I can see other ways to manipulate the shown pricing, but the above should be all you need to do... :idea:

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Brian,

holy s...t what a mess oO I can't believe that somebody is selling a Multilingual Software and the whole promo sites from the connect store isn't translatable. :wall1:

Thank you I will try to get the rest translated hopefully O.o .

Greetings Christian

 

Share this post


Link to post
Share on other sites

Hi Christian,

19 hours ago, wp4all said:

holy s...t what a mess oO I can't believe that somebody is selling a Multilingual Software and the whole promo sites from the connect store isn't translatable. :wall1:

multilingual, like a lot of things with WHMCS, is seemingly an afterthought... what's the point of having a WHMCS installation that is multilingual throughout (more or less), only to get to the MarketConnect pages and find everything is in English ?? it's been 10 months since v7.2 was launched with MC included... and people think i'm joking about WHMCS development being slow... ten months and we're still no nearer to having MC multilingual by default.

it's so short-sighted that it simply beggars belief - there are people at the top of WHMCS, perhaps even every developer working there, who should all be taking a good long look at themselves for continuously pumping out this nonsense... they won't, and nothing will change, but they really should.

I don't see why instead of calling hardcoded English strings, they couldn't have used language strings in the arrays like the rest of WHMCS... it would be far simpler to do that than what I did by converting the hardcoded strings back to the users language.... even if they were all moved to language strings just in English copied throughout the other languages, at least that would give those who want to translate an easy starting point...

I don't think the "official" way to do it would be any better either - apart from that you wouldn't have to edit the template... unless you want to change "Learn more..." which is hardcoded into the template and therefore cannot be change by any hook... despite there being an existing language string for that phrase already in the language files - you couldn't make this stuff up! :wall1:

for now, let's ignore the fact that it's 2018 and WHMCS still expect their users, many of whom may not be programmers, to use action hooks to add translations. naughty.gif

<?php

# MarketConnect Upsell (Slightly) Multilingual Hook
# Written by brian!

add_hook('ClientAreaFooterOutput', 1, function() {
	
	$spamheadline1 = Lang::trans('store.upsell.headline.addsecuritytoyouremailandsaygoodbyetospam');
	$spamtagline1 = Lang::trans('store.upsell.tagline.withnear100%filteringaccuracyandincreasedemailcontinuity');
	$spamfeature1 = Lang::trans('store.upsell.feature.near100%filteringaccuracy');
	$spamfeature2 = Lang::trans('store.upsell.feature.easysetupandconfiguration');
	$spamfeature3 = Lang::trans('store.upsell.feature.increasedemailcontinuityredundancy');
	$spamfeature4 = Lang::trans('store.upsell.feature.supportsupto1000emailboxes');
		
    return <<<EOF
<script>
var hashtable = {};
hashtable['Add Security to your Email and say goodbye to spam'] = '$spamheadline1';
hashtable['With near 100% filtering accuracy and increased email continuity'] = '$spamtagline1';
hashtable['Near 100% filtering accuracy'] = '$spamfeature1';
hashtable['Easy setup and configuration'] = '$spamfeature2';
hashtable['Increased email continuity &amp; redundancy'] = '$spamfeature3';
hashtable['Supports up to 1000 email boxes'] = '$spamfeature4';
$(document).ready(function() {
    $('.promo-banner').each(function( index ) {
        var banner = $(this);
        $.each(hashtable, function( index, value ) {
            banner.html(banner.html().replace(index, value));
        });
    });
});
</script>
EOF;
});

tizHhca.png

changes to the image below when you choose German...

d2AEudp.png

however, you still have the issue of needing to add language strings for these outputs in ALL languages otherwise you'll still get the same error we got previously.

20 hours ago, wp4all said:

Thank you I will try to get the rest translated hopefully 

when you've finished them, feel free to zip them up and send me them in a PM... I might take a closer look at the whole MC stuff when I get the chance and see if there's a cleaner way to fix them... if we wait for WHMCS to get their act together on this, then we're probably looking at v8 (assuming there isn't a v7.6) and that likely won't be until closer to the end of the year now. waiting.gif

  • Thanks 1

Share this post


Link to post
Share on other sites

I get crazy :wall1:

I got it nearly just 2 Problems still open .

He will not accept the SiteLock Headline and I have got a Problem with ' wich I tried to replace with "&apos;"

<h4>
	{$validtaglines = array('With near 100% filtering accuracy and increased email continuity','Try the SiteLock service for free','Browsers are changing, don&apos;t get left behind')}{$langtagline = "store.upsell.tagline."|cat:($promotion->getTagline()|replace:' ':''|replace:'.':''|strtolower)}{if $promotion->getTagline()|in_array:$validtaglines}{lang key="$langtagline"}{else}{$promotion->getTagline()}{/if}
</h4>

http://prntscr.com/j3f2wc

Greetings Christian

Share this post


Link to post
Share on other sites

 

Hi Brian,

I like your solution with the hook almost even better because not everything is overwritten after an update.

The $Lang File could be stored in ../lang/overrides/language.php

However, he still ignores the title of the SiteLock promo. And with the special characters, it does not work so well but that would be the hook for the client area.

image.thumb.png.469e4ac563e557b1cbcd4b19fa127694.png

 

<?php

# MarketConnect Upsell (Slightly) Multilingual Hook
# Written by brian!

add_hook('ClientAreaFooterOutput', 1, function() {
	
	$spamheadline1 = Lang::trans('store.upsell.headline.addsecuritytoyouremailandsaygoodbyetospam');
	$spamtagline1 = Lang::trans('store.upsell.tagline.withnear100%filteringaccuracyandincreasedemailcontinuity');
	$spamfeature1 = Lang::trans('store.upsell.feature.near100%filteringaccuracy');
	$spamfeature2 = Lang::trans('store.upsell.feature.easysetupandconfiguration');
	$spamfeature3 = Lang::trans('store.upsell.feature.increasedemailcontinuityredundancy');
	$spamfeature4 = Lang::trans('store.upsell.feature.supportsupto1000emailboxes');
	$spamfeature5 = Lang::trans('store.upsell.feature.learnmore');
	$spamfeature6 = Lang::trans('store.upsell.feature.add');
	$spamfeature7 = Lang::trans('store.upsell.feature.fromjust');
	$spamfeature8 = Lang::trans('store.upsell.feature.mo');
	$spamfeature9 = Lang::trans('store.upsell.feature.yr');
	$spamfeature10 = Lang::trans('store.upsell.feature.automaticallyscanyourwebsiteformalwareandprotectonlinereputation');
	$spamfeature11 = Lang::trans('store.upsell.feature.trythesitelockserviceforfree');
	$spamfeature12 = Lang::trans('store.upsell.feature.dailymalwarescanning');
	$spamfeature13 = Lang::trans('store.upsell.feature.dailyblacklistmonitoring');
	$spamfeature14 = Lang::trans('store.upsell.feature.siteLockriskscore');
	$spamfeature15 = Lang::trans('store.upsell.feature.sitelocktrustseal');
	$spamfeature16 = Lang::trans('store.upsell.feature.protectyourwebsiteandboostyoursearchrankingswithansslcertificate');
    $spamfeature17 = Lang::trans('store.upsell.feature.includedwithyoursslcertificate');
    $spamfeature18 = Lang::trans('store.upsell.feature.dataprotectionupto256-bitencryption');
    $spamfeature19 = Lang::trans('store.upsell.feature.unlimitedfreereissues');
    $spamfeature20 = Lang::trans('store.upsell.feature.compatiblewithallmajorbrowsers');
    $spamfeature21 = Lang::trans('store.upsell.feature.displayasecuritysealonyoursite');
    $spamfeature22 = Lang::trans('store.upsell.feature.buildyourwebsitewitheaseusingthepowerfulweeblysitebuilder');
    $spamfeature23 = Lang::trans('store.upsell.feature.weebly&apos;spowerfuldraganddropwebsitebuilderandguidedsetupgetyoutothefinishlinefasternocodingneeded');<-- Error
    $spamfeature24 = Lang::trans('store.upsell.feature.rangeofstunningthemestochoosefrom');
    $spamfeature25 = Lang::trans('store.upsell.feature.draganddropeditor');
    return <<<EOF
<script>
var hashtable = {};
hashtable['Add Security to your Email and say goodbye to spam'] = '$spamheadline1';
hashtable['With near 100% filtering accuracy and increased email continuity'] = '$spamtagline1';
hashtable['Near 100% filtering accuracy'] = '$spamfeature1';
hashtable['Easy setup and configuration'] = '$spamfeature2';
hashtable['Increased email continuity & redundancy'] = '$spamfeature3';
hashtable['Supports up to 1000 email boxes'] = '$spamfeature4';
hashtable['Learn more...'] = '$spamfeature5';
hashtable['Add'] = '$spamfeature6';
hashtable['from just'] = '$spamfeature7';
hashtable['/mo'] = '$spamfeature8';
hashtable['/yr'] = '$spamfeature9';
hashtable['Automatically scan your website for malware and protect online reputation'] = '$spamfeature10';
hashtable['Try the SiteLock service for free'] = '$spamfeature11';
hashtable['Daily Malware Scanning'] = '$spamfeature12';
hashtable['Daily Blacklist Monitoring'] = '$spamfeature13';
hashtable['SiteLock Risk Score'] = '$spamfeature14';
hashtable['Sitelock Trust Seal'] = '$spamfeature15';
hashtable['Protect your website and boost your search rankings with an SSL certificate'] = '$spamfeature16';
hashtable['Included with your SSL certificate'] = '$spamfeature17';
hashtable['Data protection up to 256-bit encryption'] = '$spamfeature18';
hashtable['Unlimited free reissues'] = '$spamfeature19';
hashtable['Compatible with all major browsers'] = '$spamfeature20';
hashtable['Display a security seal on your site'] = '$spamfeature21';
hashtable['Build your website with ease using the Powerful Weebly Site Builder'] = '$spamfeature22';
hashtable['Weebly&apos;s powerful drag and drop website builder and guided set up get you to the finish line faster, no coding needed.'] = '$spamfeature23'; <--Error
hashtable['Range of stunning themes to choose from'] = '$spamfeature24';
hashtable['Drag and drop editor'] = '$spamfeature25';
	$(document).ready(function() {
    $('.promo-banner').each(function( index ) {
        var banner = $(this);
        $.each(hashtable, function( index, value ) {
            banner.html(banner.html().replace(index, value));
        });
    });
});
</script>
EOF;
});

Greetings Christian

Share this post


Link to post
Share on other sites

Hi Christian,

15 hours ago, wp4all said:

I like your solution with the hook almost even better because not everything is overwritten after an update.

you'll still have to check it after every update though because if WHMCS change any of their strings, the relevant translations won't work... and there is a typo in one of them, so they'll likely change that in a future release.

15 hours ago, wp4all said:

However, he still ignores the title of the SiteLock promo.

wtf :mad:

there's nothing special about that string - no special characters, no additional spacing that I can see, nothing in the array that makes it any different from the other promo headlines.... I can change everything else, yet this one headline doesn't change. :?:

hopefully one of the WHMCS devs may stumble across the thread and point out what i'm missing with that string, because I can't see why it doesn't get changed by the hook.

15 hours ago, wp4all said:

And with the special characters, it does not work so well but that would be the hook for the client area.

try using this instead...

$spamfeature23 = Lang::trans('store.upsell.feature.weeblyspowerfuldraganddropwebsitebuilderandguidedsetupgetyoutothefinishlinefasternocodingneeded');

btw - you don't necessarily need to use long strings in the naming of the language strings... the value below would work equally as well as long as it matched the name of the string in the overrides file(s)... and it doesn't matter what you call the variables either (as long as they're unique).

$spamfeature23 = Lang::trans('store.upsell.feature.weeblyspowerful');
hashtable['Weebly\'s powerful drag and drop website builder and guided set up get you to the finish line faster, no coding needed.'] = '$spamfeature23';
$_LANG['store']['upsell']['feature']['weeblyspowerfuldraganddropwebsitebuilderandguidedsetupgetyoutothefinishlinefasternocodingneeded'] = "Weebly&apos;s leistungsstarker Drag-and-Drop-Website-Builder und das geführte Setup bringen Sie schneller ins Ziel, ohne Programmierung";

U4kCmKA.png

so I mentioned there was a typo... it's "Sitelock Trust Seal" - it should be "SiteLock Trust Seal"...

7pzMiIv.png

assuming they fix it in a later release, it would no longer match your current hook string term, but you could do the following to make it work under both circumstances (Sitelock and SiteLock)...

hashtable['Sitelock Trust Seal'] = '$sitelockfeature3';
hashtable['SiteLock Trust Seal'] = '$sitelockfeature3';

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Brian,

found it :wall1:

 I found the Problem when I opened the Inspector -->

image.png.b82023cfa4d790c777708e71b537ada4.png

Now it works -->

image.thumb.png.f1b2b27f7ccd1035fc0bb9c464d026d8.png

 

Quote

you'll still have to check it after every update though because if WHMCS change any of their strings, the relevant translations won't work... and there is a typo in one of them, so they'll likely change that in a future release.

Yea but you don't have to edit all the 22 x store.php Files :-)  just quick review if there was an change copy & paste and done .

So finally I will translate it grammatically correct optimise the $Lang -Files and than I will send you the *.zip

Greetings Christian

Share this post


Link to post
Share on other sites

Hi @ all,

does anybody know which part is responsible for :

image.png.2c7e208b38985e14b42346307e018a37.png

Is none of this Files :

image.png.b98089ba867062f9fbda3851f11959c1.png

 

 

Is there really so bad experiences in this community here, that every simple Question needs to be be released by an Admin ?

I just started here and it already pissed me off waiting a day to get my post activated.

 

Greetings Christian

Share this post


Link to post
Share on other sites

Hi Christian,

playing with this further today, I pasted the awkward "SiteLock" string into an online HTML converter and there does appear to be a special character in there between the words 'protect' and 'online'...

QYJw0e_LYSry-yrn_VUf9j_ZA.png

now that I know that, we can do this...

$sitelockheadline = Lang::trans('store.upsell.headline.automaticallyscanyourwebsiteformalwareandprotectonlinereputation');

I can't post the hashtable code as text here because the f0rum converts the special character back into a space, but i'll paste the image of my code locally...

CMSGXL3.png

basically, it's the same as the first image but with the <p> and </p> removed.

MjvTNw3.png

Share this post


Link to post
Share on other sites

HI Brian,

Yeah I found it as well. But my post hangs in the que, maybe you got an Idea as well see my post above.

 

Greetings Christian

Share this post


Link to post
Share on other sites
On 4/11/2018 at 18:17, wp4all said:

Yea but you don't have to edit all the 22 x store.php Files :-)  just quick review if there was an change copy & paste and done .

well you don't because you've already made the changes... but others starting from scratch will have to... not so much the upsell stuff (apart from the hard-coded English), but the sales pages.

On 4/11/2018 at 18:17, wp4all said:

So finally I will translate it grammatically correct optimise the $Lang -Files and than I will send you the *.zip

that would be appreciated. bow_down_before_you-960.gif

On 4/12/2018 at 14:06, wp4all said:

does anybody know which part is responsible for :

oh i've done this before... can't find the thread... aah here we go... :631_bulb:

the hashtable solution would still work, though you'll need to use a second hook - for now, do it as a separate file (or 2nd hook after the original hook), but at some point in the future, i'll integrate them into one hook for both cart and upsells...

<?php

add_hook('ClientAreaFooterOutput', 1, function() {
	
	$spamheadline = Lang::trans('store.addon.headline.spamexpertsemailsecurity');
	$spamtagline = Lang::trans('store.addon.tagline.addprofessionalemailsecurityandarchivingtoyourdomaintoprotectandsecureyouremailagainstattacksandmalware');
	$learnmore = Lang::trans('learnmore');
	
	return <<<EOF
<script>
var hashtable = {};
hashtable['SpamExperts Email Security'] = '$spamheadline';
hashtable['Add professional email security and archiving to your domain to protect and secure your email against attacks and malware.'] = '$spamtagline';
hashtable['Learn more'] = '$learnmore';

$(document).ready(function() {
    $('.addon-promo').each(function( index ) {
        var banner = $(this);
        $.each(hashtable, function( index, value ) {
            banner.html(banner.html().replace(index, value));
        });
    });
});
</script>
EOF;
});
$_LANG['store']['addon']['headline']['spamexpertsemailsecurity'] = "SpamExperts Email Sicherheit";
$_LANG['store']['addon']['tagline']['addprofessionalemailsecurityandarchivingtoyourdomaintoprotectandsecureyouremailagainstattacksandmalware'] = "Fügen Sie Ihrer Domain professionelle E-Mail-Sicherheit und Archivierung hinzu, um Ihre E-Mails vor Angriffen und Malware zu schützen und zu schützen.";

l_Uo_Frb1_PQ4_U_kkw_VWK1_Rw.png

On 4/12/2018 at 15:03, wp4all said:

Yeah I found it as well. But my post hangs in the queue, maybe you got an Idea as well see my post above.

sadly not - it didn't appear in the Firefox inspector (but seemingly does in Chrome!)... anyway, I went back to trying the original Smarty {if} statement solution and it didn't work; so then started to use string searches and spotted that it worked up until the word 'online'... so realised there must be something there.

Share this post


Link to post
Share on other sites
Posted (edited)

Hi Brian,

it is not working when I add the hook than you are not more able to use on of the Links.

It freezes on the default selection.

image.thumb.png.ac2e515e4225897da1f53c767da887cb.png

I also noticed that when I change the headlines, the product category will no longer displayed.

image.png.120ab398835faf3086a2ada47e0b870e.png --> image.png.84244dde0bf54d631a283947c9edb37f.png

That's pretty depressing.

There would be also the Part with Monthly and Yearly I would like to translate

Thanks and greetings Christian

P.S. Wohhooo I'm allowed to post without Board - Admin release

Edited by wp4all
Wohhooo I'm allowed to post without Board - Admin release

Share this post


Link to post
Share on other sites

Hi Christian,

27 minutes ago, wp4all said:

it is not working when I add the hook than you are not more able to use on of the Links... It freezes on the default selection.

ok, poor testing on my part... go back to using the Smarty solution I mentioned in the other thread for now.

42 minutes ago, wp4all said:

I also noticed that when I change the headlines, the product category will no longer displayed.

i'm not seeing that here locally... but there may be other reasons why i'm not.

43 minutes ago, wp4all said:

There would be also the Part with Monthly and Yearly I would like to translate

the problem here is that these addon panels do not use their own template, they're made by an action hook (or internal function) passing an array to the configureproducts.tpl template and then the template outputs that array in a simple loop...

U8KsDhf.png

therefore, because there isn't a template to edit, you would have to edit the array... ideally in a normal hook (none of this hashtable nonsense!) - but if you were going to do that, you could replace everything correctly... or even better, build it from scratch however you want it to use language strings directly... would take time, but it could definitely be done...

the quick fix for this with regards to monthly/yearly, would be to do a Smarty string replace in configureproduct.tpl to replace the existing {foreach $addonsPromoOutput as $output} already in the template.

{foreach $addonsPromoOutput as $output}
	<div>
		{$output|replace:'/mo':{lang key="store.upsell.monthly"}|replace:'/yr':{lang key="store.upsell.yearly"}}
	</div>
{/foreach}

if you had to, you could wrap it in an {if} statement if you needed it to only apply to specific languages, but I assume you've already made entries for /mo and /yr in other languages.

btw - the more you look into MarketConnect, the more of a badly-thought out mess it is. 49oa9Ad.gif

56 minutes ago, wp4all said:

P.S. Wohhooo I'm allowed to post without Board - Admin release

Congratulations! shappy_dance_100-101.gif?w=150&h=123

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @ all,

I did it  shappy_dance_100-101.gif?w=150&h=123 even the Order overview got now the right translation.

image.png.1869bad0402fe905365348deef41e3bc.png --> image.png.55478a4e3b84877e5a641627ed20e8a2.png

Ok there are some spaces in between but the Override german.php got now 2972 Lines :51_scream:.

image.png.15f6d06d9a35928f97a8706b61bb9fec.png

Greetings Christian

Share this post


Link to post
Share on other sites

HI,

 

I found one part I would change but I'm not sure if I would do it right:

In the Pricing Table from SiteLock In US and GB is it ok to have the currency prefix in front in Germany we got it behind.

So how can I leave it as it is for US and GB but change it for GE ?

image.png.2abb69dcab8f4b72f173b116a0c40ee7.png --> image.png.13cfe6d6be9feca44ffbfc45a1fc5ff3.png

It is currently only either / or .

Greetings Christian

Share this post


Link to post
Share on other sites

Hi Christian,

32 minutes ago, wp4all said:

So how can I leave it as it is for US and GB but change it for GE ?

I would suggest to try this...

{$plan->name}
<span class="pull-right">
	{if $plan->isFree()}
		FREE
	{elseif $plan->pricing()->annually()}
		{if $activeCurrency['code'] eq 'EUR'}{$plan->pricing()->annually()->toFullString()}{else}{$plan->pricing()->annually()->toPrefixedString()}{/if}
	{elseif $plan->pricing()->first()}
		{if $activeCurrency['code'] eq 'EUR'}{$plan->pricing()->first()->toFullString()}{else}{$plan->pricing()->first()->toPrefixedString()}{/if}
	{else}
		-
	{/if}
</span>

-3n_K8_AOVSc_v9_Vqh7_D_S1_Q.png

WHMCS haven't updated their documentation yet, so there's no information about toPrefixedString(), but using ->toFullString() should work.... if you need to change /yr, then it's just a replace.

Share this post


Link to post
Share on other sites
Friends, either I have not seen or written anywhere, these variables are in the database. I found it.
 
Thank you!

Share this post


Link to post
Share on other sites

But I have problem with /yr -> https://prnt.sc/jpujev

I found this coude:

                                    {if $product->pricing()->annual()}
                                        <li class="price 1yr">{$product->pricing()->annual()->yearlyPrice()}</li>
                                    {else}
                                        <li class="price 1yr na">-</li>
                                    {/if}
                                    {if $product->pricing()->biennial()}
                                        <li class="price 2yr">{$product->pricing()->biennial()->yearlyPrice()}</li>
                                    {else}
                                        <li class="price 2yr na">-</li>
                                    {/if}

But I don't know how replace and apply it with this:

{$product->pricing()->best()->breakdownPrice()|replace:'/mo':{lang key="store.upsell.monthly"}|replace:'/yr':{lang key="store.upsell.yearly"}}{/if}

Can you help me?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines