Externalize
From BabelWiki
Externalize is an extension for Firefox that semi-automatically transforms strings from .xul/xml and .js files into entities for the locale dtd / properties files.
Contents |
Informations about the extension
Who did it ?
Externalize is currently developed by Davide Ficano, also known for his great ViewSourceWith extension. Davide, aka dafi, is a member of BabelZilla dev team.
Who can use it ?
Everyone can use it :) Note that of course it is especially useful for all developers that don't know how to localize strings or are just bored at the idea of doing it manually.
Informations
Last updated version : 0.0.5.1
- Please consider this extension is still under development. You are kindly requested to report if you are encountering bugs to be fixed.
It is compatible to :
- Firefox (1.0 - 3.0.1a)
- Mozilla (1.7 - 1.8)
- Thunderbird (0.5 - 2.0)
- Netscape (8.0 - 8.1)
- Flock (1.0+)
List of included locales and translators :
- en-US
- fr-FR by Goofy
- it-IT by Dafi
- hr-HR by Krcko
- nl-NL by markh
- ru-RU by TLemur
- es-ES by ZuGro
Thanks to all translator friends !
Download it!
You can download Externalize Extension with a click on this link to dafi's site or get the last version released on A.M.O
You can also use a zipped pack containing 3 configuration files for attributes, tag and tags to exclude.
And this tiny regexp file is very useful to detect accesskeys too.
How does it work ?
Preparation
- Unzip the extension
- Create a locale folder, with a en-US subfolder inside
- Prepare 3 .txt files to get tags parsed
- attributes.txt
- tags.txt
- exclude_tags.txt
Or : you can get a zipped pack containing 3 configuration files for attributes, tag and tags to exclude.
Ten easy steps to use the extension
1. Install it - have the icon displayed in the toolbar. Click on it!
2. Enter extension name
- In the first form field you must enter the name which is the exact .jar name. If there is no jar, you have to spot the id name of the extension in the path mentionned in the chrome.manifest and/or in the install.rdf. This extension name may differ from the "displayed" name of the extension.
- The prefix entry is entirely your choice: it will be the beginning of the entities name...don't make it too long (4 or 5 letters for example).
Tip : don't use names with hyphen ("-") otherwise there will be problems with javascript files.
3. Select a file where strings must be entitized
4. Create destination file for the output, or simply select the same file as in step 3 to overwrite it
5. Select/create dtd or properties destination file in the locale/en-US subfolder. Remember :
- .dtd file is to localize strings from xul/xml files
- .properties file is to localize strings from .js files
- Tip : give the destination file the same name as the source one (with another extension of course), so that it is easier to spot and debug if necessary.
6. Click on the "Tokens" tab and select a path for each of the 3 txt files so that the extension can detect tags. You can also have your customized regular expressions to deal with .js files but this is not compulsory, the extension includes its own default regexps.
7. Set the maximum entity length (a number of chars). Don't make it too short (to avoid similar entity names) nor too long (unreadable). I currently set it on 30 for example.
8. Click on Start to launch the process.
- A dialog window appears, with all detected strings, but you have to choose which ones must be localized as displayed messages for final user. So you can check/uncheck every item or the whole list. Note that duplicate strings are recognized and listed only once.
You may also choose to change manually a variable name to make it simpler. Just click on the item or use the dedicated button.
9. The Results window will display a report about the process.
10. You can now start again on step 3 with a new file to localize, or click on Close to quit the process.
What still must be done manually
- add a content.rdf file in the locale if there is no chrome.manifest file
- add one line per locale in the install.rdf or chrome.manifest
- localize the initial description. See how to do it
ToDo List
- make the .txt files editable and customizable throughout the extension interface
- skip the comments in the parsing of js files
- pray the Lord and Great Dafi so that he may have some moments left to fumble in the extension code
Thanks to:
- Pedro for nice screenshots
- Goofy for this useful page
- Efdur for nice graphic works
- Dafi for his genius and patience















