Dutch is included in the latest Beta release.
Swedish is complete and will be included after this version is released to Addons.
Several are near completion.
If any here wish to contribute register at BabelZilla.org as a translator and begin.
Buttons:
- We've asked BabelZilla.org to open a forum for translating strings used in custombuttons submitted for translation.
- There is a specific setup for this to work successfully.
- A specific object needs to be coded in the Initialization code field. (this.properties)
- Each language is a specific object within this.properties. (en_US for english US) The _ is used vs - as that fails to work in JavaScript.
- To access the string as a translated string you call custombuttons.getLocalString( Button as Object, StringIdentifier as String)
This function returns the string specified in the locale referenced by "general.useragent.locale" in about:config prefs- Button is required so the called function knows where to get the string bundle.
- StringIdentifier is required to be in string form because it is used as an index into the language object. (Like in an Array)
- Code: Select all
this.properties = {
en_US:{ // English US translation
sLeftClick: 'Left Click',
sSLeftClick: 'Shift Left Click',
sALeftClick: 'Alt Left Click',
sCLeftClick: 'Ctrl Left Click',
sMiddleClick: 'Middle Click',
sSMiddleClick: 'Shift Middle Click',
sAMiddleClick: 'Alt Middle Click',
sCMiddleClick: 'Ctrl Middle Click',
sARightClick: 'Alt Right Click',
sCRightClick: 'Ctrl Right Click',
sHelp: '0,No help set for \n%l button \n%i.'
},
fr_FR:{ // French Translation
sLeftClick: 'clic gauche',
sSLeftClick: 'Maj clic gauche',
sALeftClick: 'Alt clic gauche',
sCLeftClick: 'Ctrl clic gauche',
sMiddleClick: 'Clic milieu',
sSMiddleClick: 'Maj clic milieu',
sAMiddleClick: 'Alt clic milieu',
sCMiddleClick: 'Ctrl clic milieu',
sARightClick: 'Alt clic droit',
sCRightClick: 'Ctrl clic droit,
sHelp: '0, pas d\'aide associée au \n%l bouton \n%i.'
}
};
getLocalString example: (Included in the extension)
- Code: Select all
custombuttons.getLocalString = function( btn, sRef )
{
var p = btn.properties;
var locale = custombuttons.getPrefs( 'general.useragent.locale' ).replace(/\-/,'_'); // This gets the locale and converts into an obj
return p[locale][sRef]; // This pulls the correct string and returns it to the button.
}
- To get your button translated:
- You need to create the above code Object and fill the en_US object with your strings. (Only user viewed strings are to be translated)
- Strings used in logic tests should generally avoid translation.
- Register with or login to BabelZilla.org
- Create a ButtonNamed.properties file with only the list of strings to translate.
- Create a html file for your button via "Backup this Button".
- Create a new topic here.
- Attach the above 2 files. (See this example)
