You currently have Javascript disabled, to use some of the features (such as the login) you must enable it for this site
BabelZilla Translations | Custom Buttons²

BabelZilla Translations

Post & Get buttons here
Forum rules
Click Here

Please report broken buttons by clicking the report icon Image in the post.

Postby SCClockDr on Tue Nov 06, 2007 2:35 am

Custom Buttons² has entered the process of translating user viewed strings at BabelZilla.org

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.
    1. A specific object needs to be coded in the Initialization code field. (this.properties)
    2. 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.
    3. 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)
this.properties object example:
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)
This is quite new so response may be slow at first.
Last edited by SCClockDr on Tue Nov 06, 2007 2:45 am, edited 3 times in total.
Reason: Change to Announcement.
Custom Buttons²: V2.0.7.5
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
User avatar
SCClockDr
Admin
Admin
 
Posts: 824
Joined: Thu Jun 14, 2007 7:28 pm
Location: SC UpState

Return to Buttons Database

Who is online

Users browsing this forum: • Registered: 0 and 0 guests