Jump to content

marketplace modules languages files?


Recommended Posts

Hi guys, anyone know which one is the path to the marketplace modules languages files? for example in the weebly module i see the files have hardcoded text and only the headline and the tagline have language variables.

you've answered your own question - there are none, they were launched with everything hardcoded into English. :roll:

 

for example, you could change...

 

            <li><a href="#" onclick="smoothScroll('#overview');return false">Overview</a></li>
           <li><a href="#" onclick="smoothScroll('#features');return false">Features</a></li>
           <li><a href="#" onclick="smoothScroll('#pricing');return false">Pricing</a></li>
           <li><a href="#" onclick="smoothScroll('#faq');return false">FAQ</a></li>

to...

            <li><a href="#" onclick="smoothScroll('#overview');return false">{lang key="store.websiteBuilder.overview"}</a></li>
           <li><a href="#" onclick="smoothScroll('#features');return false">{lang key="store.websiteBuilder.features"}</a></li>
           <li><a href="#" onclick="smoothScroll('#pricing');return false">{lang key="store.websiteBuilder.pricing"}</a></li>
           <li><a href="#" onclick="smoothScroll('#faq');return false">{lang key="store.websiteBuilder.faq"}</a></li>

and then you'd need to use Language Overrides to add your translations...

$_LANG['store']['websiteBuilder']['overview'] = "Overview";
$_LANG['store']['websiteBuilder']['features'] = "Features";
$_LANG['store']['websiteBuilder']['pricing'] = "Pricing";
$_LANG['store']['websiteBuilder']['faq'] = "FAQ";

they'll probably be updated to use language strings by default at some point - but i've no idea when.

Link to comment
Share on other sites

  • 2 weeks later...
WAs a hard work but is done...any idea where is the text used for the promotions? the once placed in the client area home and in the side menu? Im not finding them.

the chances are that if WHMCS didn't create language strings for the MarketConnect templates, then they won't use them in the sidebars either. :mad:

 

although you should be able to use action hooks to add language strings to the sidebar labels - http://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet#Changing_the_Text_Label_of_a_Sidebar_Item

 

->setLabel(Lang::trans('*language string*'))

with regards to promotion templates, do you mean the ones in the "promos" folder ?

Link to comment
Share on other sites

I did check the promos folder thinking perhaps those have more hardcoded english, without luck.

I mean the promos showing in the cart, and the client area home and below the sidebar...attached images.

having taken a closer look, i'm fairly certain that it's the promos folder you should be looking at... specifically cart.tpl for the cart, and upsell.tpl (and/or slimupsell.tpl) for the clientarea homepage.

 

the easiest way to check is that "Learn more..." is hardcoded into each - so edit the templates and change that line of text to something different in each (e. g "Learn More.... (cart)" etc).

 

assuming that proves i'm correct, then for the next step I can think of two options - either these products/descriptions etc are defined somewhere visible in the admin area (i'm working blind here as I don't have marketconnect active in my v7.2 dev)... although even if they are defined, i'm not sure it gets us any further as I assume even if you could edit them, you could only change the text for everyone, not for individual languages...

 

... or they are defined internally in English... which i'm tempted to think is crazy, lazy and annoying for anyone who wants/has a multi-lingual WHMCS site. :twisted:

 

I suspect I can fix the templates to be multilingual - though i'm working on the theory that as your site is English/Spanish and you're happy to use the existing text for English, but want to change it for Spanish users (though I could change English version too if I have to) - it should just be a series of {if} statements in the template, but i'm going to need to see a {debug} window of one of the templates (doesn't matter which - if it works on one, it should work on all of them)... you should also be able to update the product features into Spanish too using the same technique.

 

u8wLDgF.png

 

so if you can add {debug} to the end of one the promos templates and PM the output of the popup window to me, I should be able to work out the correct Smarty code to use.

Link to comment
Share on other sites

  • 3 weeks later...
I'm looking the same to translate in German but without success now.

I know you've already posted in the thread i'm going to post below, but if you can get the updated templates from one of the guys that have translated it into Spanish from that thread, then you should be able to use that yourself and add your German translations as Language Overrides.

 

I have added {debug} to the clientareahome.php where I can see the promos, but I can`t see the text I want to translate in the Smarty Debug Console popup.

the templates themselves will be in /templates/six/store, and they're either be hardcoded in English, or using arrays pulling the information from the database.

 

the thread below might give you some clues as to how to translate or even edit the text for other languages.

 

https://forum.whmcs.com/showthread.php?130618-Help-translating

Link to comment
Share on other sites

Hi,

Yes I did mostly with language overrides in template files but it is some parts which is not possible to translate. See attached image.

it is possible, you just need to use Language Overrides to translate the $features array - so in /templates/six/store/weebly/index.tpl, it currently contains...

<div class="feature-heading">Site Features</div>
   <ul class="site-features">
       {foreach $product->siteFeatures as $feature}
           <li>
               {$feature}
           </li>
       {/foreach}
   </ul>
<div class="feature-heading">eCommerce Features</div>
   <ul class="ecommerce-features">
       {foreach $product->ecommerceFeatures as $feature}
           <li>
               {$feature}
           </li>
       {/foreach}
   </ul>

if we change it to...

<div class="feature-heading">Site Features</div>
   <ul class="site-features">
       {foreach $product->siteFeatures as $feature}
           <li>
               {if $LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{$LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{else}{$feature}{/if}
           </li>
       {/foreach}
   </ul>
<div class="feature-heading">eCommerce Features</div>
   <ul class="ecommerce-features">
       {foreach $product->ecommerceFeatures as $feature}
           <li>
               {if $LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{$LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{else}{$feature}{/if}
           </li>
       {/foreach}
   </ul>

if we then add some new Language Overrides strings in /lang/overrides/german.php (or any language)...

$_LANG['store']['websiteBuilder']['feature']['drag&dropbuilder'] = "Ziehen Sie per Drag&Drop Builder";
$_LANG['store']['websiteBuilder']['feature']['unlimitedpages'] = "Unbegrenzte Seiten";
$_LANG['store']['websiteBuilder']['feature']['3%weeblytransactionfees'] = "3% weebly Transaktionsgebühren";
$_LANG['store']['websiteBuilder']['feature']['upto10products'] = "Bis zu 10 Produkte";
$_LANG['store']['websiteBuilder']['feature']['checkoutonweeblycom'] = "Kasse auf Weebly.com";

we can then do this (apologies for the German, blame it on Google Translate!)...

 

fmpsxzZ.png

 

it works by checking if there is a language translation for the current feature - if so, it will use it; if not, it displays the existing feature text - that's why in the above image, some features have been translated to German, and others haven't... but as soon as you add the language override strings for the other features, the template will use them. :idea:

 

just remember, when naming the language override strings, to remove spaces, periods (.) and use lowercase... so for the feature, "Password Protection", as a language override, it will be....

$_LANG['store']['websiteBuilder']['feature']['passwordprotection'] = "Passwortschutz";

Link to comment
Share on other sites

Hi,

 

it is possible, you just need to use Language Overrides to translate the $features array - so in /templates/six/store/weebly/index.tpl, it currently contains...

<div class="feature-heading">Site Features</div>
   <ul class="site-features">
       {foreach $product->siteFeatures as $feature}
           <li>
               {$feature}
           </li>
       {/foreach}
   </ul>
<div class="feature-heading">eCommerce Features</div>
   <ul class="ecommerce-features">
       {foreach $product->ecommerceFeatures as $feature}
           <li>
               {$feature}
           </li>
       {/foreach}
   </ul>

if we change it to...

<div class="feature-heading">Site Features</div>
   <ul class="site-features">
       {foreach $product->siteFeatures as $feature}
           <li>
               {if $LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{$LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{else}{$feature}{/if}
           </li>
       {/foreach}
   </ul>
<div class="feature-heading">eCommerce Features</div>
   <ul class="ecommerce-features">
       {foreach $product->ecommerceFeatures as $feature}
           <li>
               {if $LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{$LANG.store.websiteBuilder.feature.{$feature|replace:' ':''|replace:'.':''|strtolower}}{else}{$feature}{/if}
           </li>
       {/foreach}
   </ul>

if we then add some new Language Overrides strings in /lang/overrides/german.php (or any language)...

$_LANG['store']['websiteBuilder']['feature']['drag&dropbuilder'] = "Ziehen Sie per Drag&Drop Builder";
$_LANG['store']['websiteBuilder']['feature']['unlimitedpages'] = "Unbegrenzte Seiten";
$_LANG['store']['websiteBuilder']['feature']['3%weeblytransactionfees'] = "3% weebly Transaktionsgebühren";
$_LANG['store']['websiteBuilder']['feature']['upto10products'] = "Bis zu 10 Produkte";
$_LANG['store']['websiteBuilder']['feature']['checkoutonweeblycom'] = "Kasse auf Weebly.com";

we can then do this (apologies for the German, blame it on Google Translate!)...

 

fmpsxzZ.png

 

it works by checking if there is a language translation for the current feature - if so, it will use it; if not, it displays the existing feature text - that's why in the above image, some features have been translated to German, and others haven't... but as soon as you add the language override strings for the other features, the template will use them. :idea:

 

just remember, when naming the language override strings, to remove spaces, periods (.) and use lowercase... so for the feature, "Password Protection", as a language override, it will be....

$_LANG['store']['websiteBuilder']['feature']['passwordprotection'] = "Passwortschutz";

 

Hi Brian,

 

Thank you very much. You saved my day. Now is working fine except "Ideal for". It looks like other coded as $feature. And now upsells/promos/sidebars are according this page https://docs.whmcs.com/Customising_MarketConnect_Promotions_and_Upsells possible to customize via hooks it but language strings are not accepted. Neither in hashtable['Protect your website'] = 'Protect your domain'; nor in Sidebar promotions.

 

PHP code:

->setLabel(Lang::trans('*language string*')) 

give ma an error. Have you any idea what is correct syntax if possible to use language strings?

2017-07-07_15-14-04.png

2017-07-07_15-16-21.png

Link to comment
Share on other sites

Thank you very much. You saved my day. Now is working fine except "Ideal for". It looks like other coded as $feature.

for the "Ideal For" problem, you need to edit...

<h5>Ideal for {$product->idealFor}</h5>

to...

<h5>Ideal für {if $LANG.store.websiteBuilder.idealfor.{$product->idealFor|replace:'  ':''|replace:'+':''|strtolower}}{$LANG.store.websiteBuilder.idealfor.{$product->idealFor|replace:'   ':''|replace:'+':''|strtolower}}{else}{$product->idealFor}{/if}</h5>

and then in the language files...

$_LANG['store']['websiteBuilder']['idealfor']['personaluse'] = "Persönlichen Gebrauch";
$_LANG['store']['websiteBuilder']['idealfor']['groupsorganizations'] = "Gruppen + Organisationen";
$_LANG['store']['websiteBuilder']['idealfor']['businessesstores'] = "Unternehmen + Shops";

 

NUQcbju.png

 

btw - ignore that I hardcoded "Ideal für" into the output - i'm assuming you're using a separate Language Override for that. :idea:

 

And now upsells/promos/sidebars are according this page https://docs.whmcs.com/Customising_MarketConnect_Promotions_and_Upsells possible to customize via hooks it but language strings are not accepted. Neither in hashtable['Protect your website'] = 'Protect your domain'; nor in Sidebar promotions.

give ma an error. Have you any idea what is correct syntax if possible to use language strings?

for upsells/promos, they're still just templates, e.g that Weebly upsell is from order.tpl and you can edit it in exactly the same way using Language Overrides...

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

to...

<h3>{if $LANG.store.order.{$promotion->getHeadline()|replace:' ':''|replace:',':''|replace:'.':''|strtolower}}{$LANG.store.order.{$promotion->getHeadline()|replace:' ':''|replace:',':''|replace:'.':''|strtolower}}{else}$promotion->getHeadline(){/if}</h3>

$_LANG['store']['order']['upgradetoweeblypro'] = "Upgrade auf Weebly Pro";

 

UvGZeoo.png

 

and then just as before, it's a case of working through the template and doing similar changes to the taglines, features arrays etc.

 

with regards to the hashtable nonsense, quickly tried the hook provided as is, but couldn't get it to work with language files - it might be possible, but i'll leave it to WHMCS to post their own solution.

 

but seriously, which idiot @ WHMCS thinks it's totally acceptable to expect their users, who may not necessarily be programmers, to use action hooks to modify strings?? probably the same fool who with v6 expected them to do it for menus as well. :mad:

 

it's bad enough doing it this way with language overrides because WHMCS couldn't be bothered to make the feature/templates truly multilingual before launch, but using hooks calling javascript... jeez - I can remember why I said I wasn't going to touch this MarketConnect nonsense with a bargepole.

 

if you want my advice, carry on using this language override method unless/until WHMCS come up with something better than this.

 

with regards to the sidebars, then you should be able to use language strings in them... but I don't recall seeing this promo sidebar anywhere, so if you can give me a screenshot of exactly where it is, I may be able to look into it further.

Link to comment
Share on other sites

with regards to the sidebar, here's an example of using a language string in the body - you can do the same with titles and footers too...

 

<?php

add_hook('ClientAreaSidebars', 1, function() {

   $secondarySidebar = Menu::secondarySidebar();

   $websiteBuilderPromo = $secondarySidebar->getChild('Website Builder Promo');
   if (!is_null($websiteBuilderPromo)) {

       $title = 'Add Website Builder';

       $bodyHtml = '<p>'.Lang::trans('store.websiteBuilder.sidebarbody').'</p>';

       $footerHtml = '<a href="'.routePath('store-websitebuilder-index').'">
               <i class="fa fa-shopping-cart fa-fw"></i>
               Get started from just $5
           </a>';

       $websiteBuilderPromo->setLabel($title)
           ->setBodyHtml($bodyHtml);
           //->setFooterHtml($footerHtml);

   }
});

$_LANG['store']['websiteBuilder']['sidebarbody'] = "Schaffen Sie eine atemberaubende Website schneller als je zuvor mit Weebly";

 

WO2zwdM.png

 

in the above code, i've disabled changing the footer - but that's only because it's mentions a price and you might not necessarily want to do that with a multilingual output as you might end up needing to query the database to get a price in the client's currency. :roll:

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...
  • WHMCS Support Manager

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!

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.

×
×
  • 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