Magento Forum

   
Translate Javascript Popups
 
markus.schall
Jr. Member
 
Total Posts:  12
Joined:  2008-06-01
Reutlingen, Germany
 

Hi,

i want to translate my magento-shop to german. i’ve also installed the german translation pack, but translations in javascript error popups won’t be translate.

for example: when i go to checkout and don’t check the shipping method, a javascript-error “Please specify shipping method.” appears. when i add this text-line to my translation csv, it didn’t work.

the alert message is in the js-file “opcheckout.js”:

// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype {
    initialize
: function(formsaveUrl){
        this
.form form;
        
this.saveUrl saveUrl;
        
this.validator = new Validation(this.form);
        
this.onSave this.nextStep.bindAsEventListener(this);
        
this.onComplete this.resetLoadWaiting.bindAsEventListener(this);
    
},

    
validate: function() {
        
var methods document.getElementsByName('shipping_method');
        if (
methods.length==0{
            alert(Translator
.translate('Your order can not be completed at this time as there is no shipping methods available for it. Please make neccessary changes in your shipping address.'));
            return 
false;
        
}

        
if(!this.validator.validate()) {
            
return false;
        
}

        
for (var i=0i<methods.lengthi++) {
            
if (methods[i].checked{
                
return true;
            
}
        }
        alert(Translator
.translate('Please specify shipping method.'));
        return 
false;
    
},

    ...

can anybody help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jdurand
Jr. Member
 
Total Posts:  9
Joined:  2008-05-16
 

Have you turned inline translation on in the configuration>developer section.  That seems to work for me.  Then just make your changes and trun it off…

 
Magento Community Magento Community
Magento Community
Magento Community
 
markus.schall
Jr. Member
 
Total Posts:  12
Joined:  2008-06-01
Reutlingen, Germany
 

that don’t work, because the error message appears in a popup-window, so you can’t translate it there

 
Magento Community Magento Community
Magento Community
Magento Community
 
markus.schall
Jr. Member
 
Total Posts:  12
Joined:  2008-06-01
Reutlingen, Germany
 

i found a bug issue that solved my problem. there is a workaround and would be fixed in the next version: bug issue #5032

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top