Jump to content

Help translating


ocastaned

Recommended Posts

I can see three ways to fix this (though it shouldn't have been so badly thought out that such fixes were necessary! :mad:)...

 

one option would be to use an action hook to modify the $addonsPromoOutput array and I suspect that if you were doing a true multilingual solution, that would be the way to go... but as you're only asking about one language and hopefully only a temporary fix is required (until WHMCS get their act together), the other two options can be achieved by editing the /templates/orderforms/standard_cart (or custom)/configureproduct.tpl template by changing...

                            {foreach $addonsPromoOutput as $output}
                               <div>
                                   {$output}
                               </div>
                           {/foreach}

to...

                            {foreach $addonsPromoOutput as $output}
                               <div>
                               {if $language eq 'spanish' and $output|strstr:'Powerful Website Builder'}
                                   {$output|replace:'Powerful Website Builder':'Generador de sitios web potente'|replace:'Add Weebly\'s drag and drop website builder to your hosting to allow you to create an awesome looking website, store or blog.':'Agregue el constructor del Web site del arrastrar y de la gota de Weebly a su recibimiento para permitir que usted cree un Web site, una tienda o un blog asombroso de la mirada.'|replace:'Learn more':'Aprende más'}
                               {elseif $language eq 'spanish' and $output|strstr:'Protect your site with SSL'}                                    
                                   {$output|replace:'Protect your site with SSL':'Proteja su sitio con SSL'|replace:'Add SSL to your web hosting to give visitors confidence that your website is safe and secure and help build trust.':'Agregue SSL a su alojamiento web para dar a los visitantes la confianza de que su sitio web es seguro y ayudar a crear confianza.'|replace:'Learn more':'Aprende más'}
                               {else}
                                   {$output}
                               {/if}
                               </div>
                           {/foreach}

with apologies for the Spanish (I used Google translate!), that should give you something like this...

 

DfKtxQc.png

 

all languages (apart from Spanish) will use the default values - in the above example, i've added the translations directly into the template, but there's nothing to stop you adding Language Overrides and using them in the replaces instead of the direct translations (i've only changed Weebly in the code below)...

 

                            {foreach $addonsPromoOutput as $output}
                               <div>
                               {if $language eq 'spanish' and $output|strstr:'Powerful Website Builder'}
                                   {$output|replace:'Powerful Website Builder':{$LANG.store.websiteBuilder.addontitle}|replace:'Add Weebly\'s drag and drop website builder to your hosting to allow you to create an awesome looking website, store or blog.':{$LANG.store.websiteBuilder.addondesc}|replace:'Learn more':{$LANG.store.learnmore}}
                               {elseif $language eq 'spanish' and $output|strstr:'Protect your site with SSL'}                                    
                                   {$output|replace:'Protect your site with SSL':'Proteja su sitio con SSL'|replace:'Add SSL to your web hosting to give visitors confidence that your website is safe and secure and help build trust.':'Agregue SSL a su alojamiento web para dar a los visitantes la confianza de que su sitio web es seguro y ayudar a crear confianza.'|replace:'Learn more':'Aprende más'}
                               {else}
                                   {$output}
                               {/if}
                               </div>
                           {/foreach}

$_LANG['store']['websiteBuilder']['addontitle'] = "Generador de sitios web potente";
$_LANG['store']['websiteBuilder']['addondesc'] = "Agregue el constructor del Web site del arrastrar y de la gota de Weebly a su recibimiento para permitir que usted cree un Web site, una tienda o un blog asombroso de la mirada.";
$_LANG['store']['learnmore'] = "Aprende más";

if you wanted to change the English text too, then you could use Language Overrides and drop/adjust the language check in the if statement... that's sort of the third way I had in mind, you could really make it multilingual by checking if the override exists and using that.

 

with regards to product addon names, you can translate these if you have dynamic translations enabled in setup -> general settings -> localisation and then add the translations to the addon names using the translation button in Product addons (ignore it says Arabic, that's just to make the screenshot easier!)...

nfPwnvN.png

 

however, there is a bug in that the order summary / viewcart shows the default value and not the translated value...

 

4Ly3C43.png

 

again, with further effort, you could fix this in the templates or by using hooks, but it's ridiculous how seemingly untested these features are. :roll:

Link to comment
Share on other sites

--------UPDATE----

 

Please ignore this message below, I was just able to remove those addons from the checkout process. Thank you su much.

 

Thank you so much. It worked fine, but now my question is, is there any way to remove both Addons from the checkout process. I am asking this because even though you fix worked fine, if a customer clicks on the link "for more information" they are taking to a landing page for that product, and that landing page is completely in English language. It think it would be easy just to remove them.

 

This is a screenshot: http://prntscr.com/fqpc84

Edited by ocastaned
Link to comment
Share on other sites

for the sake of others, you can remove these addons from the cart process by unticking the "Show On Order Form" checkbox in setup -> product/services -> product addons.

 

also, you might want to send a PM to plusplushosting, from the thread below, as he's translated these new store pages into Spanish already... perhaps if you ask nicely, he might share the updated templates and language files overrides with you... I know he's done the Weebly pages, not sure about the SSL Certificates. :idea:

 

https://forum.whmcs.com/showthread.php?129858-marketplace-modules-languages-files

 

cbbjZyk.png

 

and technically, if you just wanted to change the learn more links to a specific cart group, you could expand the above solution and add another replace.

                            {foreach $addonsPromoOutput as $output}
                               <div>
                               {if $language eq 'spanish' and $output|strstr:'Powerful Website Builder'}
                                   {$output|replace:'Powerful Website Builder':{$LANG.store.websiteBuilder.addontitle}|replace:'Add Weebly\'s drag and drop website builder to your hosting to allow you to create an awesome looking website, store or blog.':{$LANG.store.websiteBuilder.addondesc}|replace:'Learn more':{$LANG.store.learnmore}|replace:'store/website-builder':'cart.php?gid=4'}
                               {elseif $language eq 'spanish' and $output|strstr:'Protect your site with SSL'}                                    
                                   {$output|replace:'Protect your site with SSL':'Proteja su sitio con SSL'|replace:'Add SSL to your web hosting to give visitors confidence that your website is safe and secure and help build trust.':'Agregue SSL a su alojamiento web para dar a los visitantes la confianza de que su sitio web es seguro y ayudar a crear confianza.'|replace:'Learn more':'Aprende más'}
                               {else}
                                   {$output}
                               {/if}
                               </div>
                           {/foreach} 

Link to comment
Share on other sites

Thank you so much. It worked fine.

 

I think I just need help with two more places to translate. One is when ordering a hosting service and customer selects that he/she will use his own domain from another company. Here a screenshot: http://prntscr.com/fqsoiw

 

And the second one is on the last page when checking out and customer do not write down credit cards details. Here a screenshot: http://prntscr.com/fqsoyy

Link to comment
Share on other sites

Thank you so much. It worked fine.

I think I just need help with two more places to translate. One is when ordering a hosting service and customer selects that he/she will use his own domain from another company. Here a screenshot: http://prntscr.com/fqsoiw

try using overrides for...

 

$_LANG['orderForm']['domainInvalid'] = 'Invalid domain name provided';
$_LANG['orderForm']['domainLetterOrNumber'] = "Domains must begin with a letter or a number";

 

And the second one is on the last page when checking out and customer do not write down credit cards details. Here a screenshot: http://prntscr.com/fqsoyy

it's not in the language files, or any template - so I can only assume it's hardcoded with the stripe gateway files.,, you could class that as a bug and report it.

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