Forum closed. New forum available at http://community.wymeditor.org/

Translation of custom buttons

Support forum for WYMeditor.

Translation of custom buttons

Postby pl! on Wed Apr 23, 2008 9:16 am

Hi,

I added a custom button to my WymEditor implementation using this code:
(JavaScript)
Code: Select all
var html = "<li class='wym_tools_clearbutton'>"
                 + "<a name='ClearButton' href='#'"
                 + " title='" + WYM_STRINGS[wymLang]["ClearContent"] + "'"
                 + " style='background-image:"
                 + " url(scripts/wymedit/wymeditor/skins/default/clearbutton2.png)'>"
                 + "ClearContent"
                 + "</a></li>";

In the translation javascripts I added this line as the last entry of each array:
Code: Select all
    .
    .
    .
    Classes:          'Classes',
    Status:           'Status',
    Source_Code:      'Source code',
    ClearContent:     'Clear content'
};

WYM_STRINGS['en'] = WYM_STRINGS_EN;


The tooltip that appears below my custom button is translated, but somehow I always get an "undefined" on the english translation.
It works with german, italian and french translations but the WYM_STRINGS['en'] array doesn't even hold a value for the key "ClearContent".
Is the english translation file cleaned or overwritten somewhere else to ensure a clean default translation ?
pl!
 
Posts: 8
Joined: Thu Jan 31, 2008 2:37 pm

Re: Translation of custom buttons

Postby jfh on Tue Apr 29, 2008 8:17 pm

Strange. Is there a test page available?
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: Translation of custom buttons

Postby pl! on Tue May 06, 2008 7:11 am

Sorry, no testpage. The whole thing is only accessible via the company's intranet
pl!
 
Posts: 8
Joined: Thu Jan 31, 2008 2:37 pm

Re: Translation of custom buttons

Postby pl! on Mon May 19, 2008 7:56 am

Finally, I was able to fix it!

There's another array holding english translations at the beginning of jquery.wymeditor.js. I copied my additional translation field into that array and it works.
pl!
 
Posts: 8
Joined: Thu Jan 31, 2008 2:37 pm

Re: Translation of custom buttons

Postby jfh on Mon May 19, 2008 8:34 pm

I see :)

FYI, since 0.5 this behavior has been removed from the makefile.
Language files are now dynamically loaded.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests