brian! Posted September 14, 2018 Share Posted September 14, 2018 this is what I see in the v7.6.1 dev for English... and in German... after a quick investigation, I now know that it's pulling that description from the Product Description... which in practical terms means it's being pulled from the database... it also works for descriptions using Dynamic Field Translations too. so I can only assume that for the Weebly Lite product you have "Description goes here..." in your product description? 0 Quote Link to comment Share on other sites More sharing options...
wp4all Posted September 14, 2018 Author Share Posted September 14, 2018 Hi Brian, got it. Strange. Thank you Christian 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 23, 2018 Share Posted September 23, 2018 Hello. Where can I translate this section? (SiteLock) 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 23, 2018 Share Posted September 23, 2018 And how can I edit "Learn more" link in client are: https://prnt.sc/kxpnmw 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 23, 2018 Share Posted September 23, 2018 1 hour ago, Tengri said: Where can I translate this section? (SiteLock) you can't - "Manage Your Security" and "Choose Domain" are seemingly hardcoded in English! 🙄 for something like this, the better solution is probably just to treat them as homepagepanels and adjust them accordingly... <?php # SiteLock HomePagePanel Translate Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaHomepagePanels', 1, function(MenuItem $homePagePanels) { $sitelocklabel = Lang::trans('sitelocklabel'); $sitelocklogin = $homePagePanels->getChild('SitelockLogin'); if((Lang::trans($sitelocklabel) != 'sitelocklabel') && !is_null($sitelocklogin)){ $sitelocklogin->setLabel(Lang::trans('sitelocklabel')); $sitelockbody = $sitelocklogin->getBodyHtml(); $newbody = str_replace('Choose Domain', Lang::trans('cartproductdomainchoose'), $sitelockbody); $sitelocklogin->setBodyHtml($newbody); } }); $_LANG['sitelocklabel'] = "Verwalten Sie Ihre Sicherheit"; I haven't done it in the above hook, but you could do the same for the Weebly panel too... also, I haven't translated/removed the "Powered by" line, but again you could easily do either by modifying the hook. 33 minutes ago, Tengri said: And how can I edit "Learn more" link in client are: https://prnt.sc/kxpnmw I think that's already been solved by other solutions in this thread - e.g hooks... even the silly hashtable nonsense. 1 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 23, 2018 Share Posted September 23, 2018 You know I don't understand hooks at all. Moreover, I do not understand it as such. But I really need to change the link in the promo in the client panel. Because for SiteLock we use another page. And on the panel this link go to to /store/sitelock.php. I need change this link to "sitelock.php" only. Without store. Could you add the right lines for me on hooks? I would be very grateful. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 23, 2018 Share Posted September 23, 2018 12 minutes ago, Tengri said: You know I don't understand hooks at all. they're not that bad - you just have to work out what type to use and where... the biggest handicap is that a lot of new features are totally undocumented - so next time WHMCS repeat the myth that there is terrific documentation provided, you have my permission to roll your eyes. 17 minutes ago, Tengri said: But I really need to change the link in the promo in the client panel. Because for SiteLock we use another page. And on the panel this link go to to /store/sitelock.php. I need change this link to "sitelock.php" only. Without store. Could you add the right lines for me on hooks? this is one of those situations where it might be more hassle to use a hook than it would to edit a template... so in /templates/six (or custom)/store/promos/upsell.tpl you could change... <small><a href="{routePath($promotion->getLearnMoreRoute())}">Learn more...</a></small> to... <small><a href="{if $promotion->getLearnMoreRoute()|strstr:'sitelock'}sitelock.php{else}{routePath($promotion->getLearnMoreRoute())}{/if}">{lang key="learnmore"}...</a></small> which changes the link for the SiteLock promo, leaves the other links alone and uses the inbuilt translation string for Learn More... 2 Quote Link to comment Share on other sites More sharing options...
wp4all Posted September 24, 2018 Author Share Posted September 24, 2018 12 hours ago, brian! said: they're not that bad - you just have to work out what type to use and where... the biggest handicap is that a lot of new features are totally undocumented - so next time WHMCS repeat the myth that there is terrific documentation provided, you have my permission to roll your eyes. Not only the documentation also the myth that it is now possible to translate easily the shop Quote Hi all, I thought it would be helpful to highlight the documentation which covers translation of MarketConnect upsells text in WHMCS v7.6: https://marketplace.whmcs.com/help/connect/kb/overview/general/customisation_and_localisation_of_promotions We hope this makes the process easier and helps increase conversions! I'm already sick of so many rolling eyes 🤢 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 15 hours ago, brian! said: this is one of those situations where it might be more hassle to use a hook than it would to edit a template... so in /templates/six (or custom)/store/promos/upsell.tpl you could change... <small><a href="{routePath($promotion->getLearnMoreRoute())}">Learn more...</a></small> to... <small><a href="{if $promotion->getLearnMoreRoute()|strstr:'sitelock'}sitelock.php{else}{routePath($promotion->getLearnMoreRoute())}{/if}">{lang key="learnmore"}...</a></small> which changes the link for the SiteLock promo, leaves the other links alone and uses the inbuilt translation string for Learn More... I change it. But unfortunately it did not work. SiteLock link has not changed. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 24, 2018 Share Posted September 24, 2018 Just now, Tengri said: I change it. But unfortunately it did not work. SiteLock link has not changed. and it's not cached in the browser? it worked yesterday when I tested it... we're talking about the animated slider, not the homepage panel correct ? 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 Just now, brian! said: and it's not cached in the browser? it worked yesterday when I tested it... we're talking about the animated slider, not the homepage panel correct ? Yes. Only in animated panel and only for SiteLock. I continue tests. 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 This is interesting. After edit this code slider banners in client area are gone. I don't know why. 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 It's kind of because of the code. I checked already on two machines. When I add the code the banner disappears. When I return the code, the banner reappears. 0 Quote Link to comment Share on other sites More sharing options...
wp4all Posted September 24, 2018 Author Share Posted September 24, 2018 (edited) Hi Tengri, try this open upsell.tpl. go to Line 11 and start replacing with this : <h3> {$promotion->getHeadline()} {if $promotion->getLearnMoreRoute()} <small><a href="{if $promotion->getLearnMoreRoute()|strstr:'sitelock'}sitelock.php{else}{routePath($promotion->getLearnMoreRoute())}{/if}">{lang key="learnmore"}...</a></small> {/if} </h3> Don't forget to create the Lang string in /whmcs/lang/overrides/your_language.php if not already there : $_LANG['learnmore'] = "Mehr erfahren ..."; This is usually what Brian tried to describe. It works for me fine : Greetings Christian Edited September 24, 2018 by wp4all 1 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 4 minutes ago, wp4all said: Hi Tengri, try this open upsell.tpl. go to Line 11 and start replacing with this : <h3> {$promotion->getHeadline()} {if $promotion->getLearnMoreRoute()} <small><a href="{if $promotion->getLearnMoreRoute()|strstr:'sitelock'}sitelock.php{else}{routePath($promotion->getLearnMoreRoute())}{/if}">{lang key="learnmore"}...</a></small> {/if} </h3> Don't forget to create the Lang string in /whmcs/lang/overrides/your_language.php if not already there : $_LANG['learnmore'] = "Erfahren Sie mehr ..."; This is usually what Brian tried to describe. Greetings Christian This is very interesting. I do it. And variables added too of course. But I get this: https://prnt.sc/kxz1tm 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 Yes. Got it. I don't know why but when I adding variables with "learnmore" I get PHP error in WHMCS. (I use only variables "learnmore" like this: [store][learnmore]='Daha ətraflı'). I change "learnmore" to variables to another and it's work. Best thanks! Thank you for taking the time for me. 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 One interesting moment. @brian! Some month ago you help me to translate "year" and "years" in order.tpl of store. I change codes to this: if $pricing->isRecurring()} {if $pricing->isYearly()} {$pricing->cycleInYears()|replace:'Year':{lang key="store.upsell.years"}} - {$pricing->yearlyPrice()|replace:'/yr':{lang key="store.upsell.yearly"}} {else} {$pricing->cycleInMonths()|replace:'Years':{lang key="store.upsell.monthly"}} - {$pricing->monthlyPrice()|replace:'/mo':{lang key="store.upsell.monthly"}} {/if} In Azerbaijani "year" and "years" is "İl" and "İllər". When you add number of year, use only "İl". Example: 1 il, 2 il. 3 il and etc. After adding this code I get end of "İl" - > "İls".This is wrong. https://prnt.sc/kxzlz9 And how translate "Month"? https://prnt.sc/kxzpk4 0 Quote Link to comment Share on other sites More sharing options...
wp4all Posted September 24, 2018 Author Share Posted September 24, 2018 (edited) Hi Tengri, could you post your $Lang_ string ? $_LANG['store']['upsell']['years'] and $_LANG['store']['upsell']['yearly'] Greetings Christian Edited September 24, 2018 by wp4all 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 24, 2018 Share Posted September 24, 2018 15 minutes ago, Tengri said: In Azerbaijani "year" and "years" is "İl" and "İllər". When you add number of year, use only "İl". Example: 1 il, 2 il. 3 il and etc. After adding this code I get end of "İl" - > "İls".This is wrong. then you could do 2 replaces - one for years, and another for year. {if $pricing->isYearly()} {$pricing->cycleInYears()|replace:'Years':{lang key="store.upsell.years"}|replace:'Year':{lang key="store.upsell.years"}} - {$pricing->yearlyPrice()|replace:'/yr':{lang key="store.upsell.yearly"}} {else} {$pricing->cycleInMonths()|replace:'Month':{lang key="store.upsell.month"}} - {$pricing->monthlyPrice()|replace:'/mo':{lang key="store.upsell.monthly"}} {/if} and then you just need to create a language override for store.upsell.month containing the Azeribijani for "Month"... I don't think it uses 'Months', but if it does, then you can do the same as the year/s code and check for months first, and then month. 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 49 minutes ago, brian! said: then you could do 2 replaces - one for years, and another for year. {if $pricing->isYearly()} {$pricing->cycleInYears()|replace:'Years':{lang key="store.upsell.years"}|replace:'Year':{lang key="store.upsell.years"}} - {$pricing->yearlyPrice()|replace:'/yr':{lang key="store.upsell.yearly"}} {else} {$pricing->cycleInMonths()|replace:'Month':{lang key="store.upsell.month"}} - {$pricing->monthlyPrice()|replace:'/mo':{lang key="store.upsell.monthly"}} {/if} and then you just need to create a language override for store.upsell.month containing the Azeribijani for "Month"... I don't think it uses 'Months', but if it does, then you can do the same as the year/s code and check for months first, and then month. I change it and add $_LANG['store']['upsell']['years'] = "İl" $_LANG['store']['upsell']['yearly'] = "İl" $_LANG['store']['upsell']['yearly'] = "Ay" string and get this: https://prnt.sc/ky0o3h I have onlu problem with "s" in ends of "İl". "Month" need translate too of course. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 24, 2018 Share Posted September 24, 2018 26 minutes ago, Tengri said: $_LANG['store']['upsell']['yearly'] = "İl" $_LANG['store']['upsell']['yearly'] = "Ay" you can't have two strings the same - how will WHMCS know which to use. 26 minutes ago, Tengri said: I have onlu problem with "s" in ends of "İl". "Month" need translate too of course. my code should fix the years issue - it would use 'il' for all years... hang on... are you using languages others than Azerbaijani? if so, I may need to think again as this might impact on other languages... "Month" should just need a language string... $_LANG['store']['upsell']['month'] = "Ay"; I should add that if you get an error page like that, you'll need to enable display errors from the general settings -> other tab and that will tell you where the error is. 0 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 6 minutes ago, brian! said: you can't have two strings the same - how will WHMCS know which to use. my code should fox the years issue - it would use 'il' for all years... "Month" should just need a language string... $_LANG['store']['upsell']['month'] = "Ay" When I add this I get error: "Oops" $_LANG['store']['upsell']['month'] = "Ay" 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 24, 2018 Share Posted September 24, 2018 you've missed out the semi-colon at the end of the lines... $_LANG['store']['upsell']['month'] = "Ay"; 1 Quote Link to comment Share on other sites More sharing options...
Tengri Posted September 24, 2018 Share Posted September 24, 2018 This code is correct? <div class="payment-term"> <h4>Müddəti seçin</h4> <select name="billingcycle" class="form-control"> {foreach $product->pricing()->allAvailableCycles() as $pricing} <option value="{$pricing->cycle()}"{if $requestedCycle == $pricing->cycle()} selected{/if}> {if $pricing->isRecurring()} {if $pricing->isYearly()} {$pricing->cycleInYears()|replace:'Years':{lang key="store.upsell.years"}|replace:'Year':{lang key="store.upsell.years"}} - {$pricing->yearlyPrice()|replace:'/yr':{lang key="store.upsell.yearly"}} {else} {$pricing->cycleInMonths()|replace:'Month':{lang key="store.upsell.month"}} - {$pricing->monthlyPrice()|replace:'/mo':{lang key="store.upsell.monthly"}} {/if} {else} {$pricing->toFullString()} {/if} </option> {/foreach} </select> </div> I add this and nothing changed. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 24, 2018 Share Posted September 24, 2018 just a quick update on the Sitelock hompagepanel hook that I posted at the weekend, Christian asked for it to include the other MarketConnect panels, so I wrote the following hook. <?php # MarketConnect HomePagePanels Translate Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaHomepagePanels', 1, function(MenuItem $homePagePanels) { $mcpanels = array('SitelockLogin','SpamexpertsLogin','WeeblyLogin'); foreach ($mcpanels as $panel) { $label = strtolower(str_replace('Login','',$panel).'label'); $loginpanel = $homePagePanels->getChild($panel); if((Lang::trans($label) != $label) && !is_null($loginpanel)){ $loginpanel->setLabel(Lang::trans($label)); $oldbody = $loginpanel->getBodyHtml(); $newbody = str_replace('Choose Domain',Lang::trans('cartproductdomainchoose'),$oldbody); $loginpanel->setBodyHtml($newbody); } } }); $_LANG['sitelocklabel'] = "Verwalten Sie Ihre Sicherheit"; $_LANG['weeblylabel'] = "Erstellen Sie Ihre Website"; $_LANG['spamexpertslabel'] = "Verwalten Sie Ihren Mailfilter"; if the language string doesn't exist for the panel heading, then it will not attempt to translate the panel. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.