User:Sardisson/Localizing Gecko Strings Redux

From Camino Wiki
Jump to: navigation, search

Beginning with Camino 2.1b1, all of the strings used by Gecko should be able to be exposed to our localizers. For more details on this, see Bug 248160, Bug 394105, and Bug 457290.

Contents

Contents of en-US.jar

unzip -t ../dist/bin/chrome/en-US.jar | grep -Ev "No errors" | grep -Ev "../dist" | cut -d ":" -f 2 | cut -d " " -f 2 | edit

Gecko .dtd files

Bug 457290 will be adding a way to localize Gecko .dtd files within Camino (as .dtd files).

Files used by Camino

locale/branding/brand.dtd * (this only says "Camino", though)
locale/en-US/global/config.dtd *
locale/en-US/global/global.dtd (used only for directionality)
locale/en-US/global/mozilla.dtd
locale/en-US/global/netError.dtd *
locale/en-US/global/xml/prettyprint.dtd
locale/en-US/mozapps/plugins/plugins.dtd *

Files not used by Camino or which need no localization

locale/en-US/cookie/cookieAcceptDialog.dtd
locale/en-US/global-region/region.dtd
locale/en-US/global/about.dtd
locale/en-US/global/aboutRights.dtd
locale/en-US/global/appPicker.dtd
locale/en-US/global/brand.dtd
locale/en-US/global/charsetOverlay.dtd
locale/en-US/global/commonDialog.dtd
locale/en-US/global/console.dtd
locale/en-US/global/crashes.dtd
locale/en-US/global/customizeCharset.dtd
locale/en-US/global/customizeToolbar.dtd
locale/en-US/global/datetimepicker.dtd
locale/en-US/global/dialogOverlay.dtd
locale/en-US/global/editMenuOverlay.dtd
locale/en-US/global/filepicker.dtd
locale/en-US/global/findbar.dtd
locale/en-US/global/finddialog.dtd
locale/en-US/global/globalKeys.dtd
locale/en-US/global/license.dtd
locale/en-US/global/netErrorApp.dtd
locale/en-US/global/notification.dtd
locale/en-US/global/nsHelperAppDlg.dtd
locale/en-US/global/nsProgressDialog.dtd
locale/en-US/global/preferences.dtd
locale/en-US/global/printdialog.dtd
locale/en-US/global/printjoboptions.dtd
locale/en-US/global/printPageSetup.dtd
locale/en-US/global/printPreview.dtd
locale/en-US/global/printPreviewProgress.dtd
locale/en-US/global/printProgress.dtd
locale/en-US/global/textcontext.dtd
locale/en-US/global/tree.dtd
locale/en-US/global/videocontrols.dtd
locale/en-US/global/viewSource.dtd
locale/en-US/global/wizard.dtd
locale/en-US/mozapps/downloads/downloads.dtd
locale/en-US/mozapps/downloads/settingsChange.dtd
locale/en-US/mozapps/downloads/unknownContentType.dtd
locale/en-US/mozapps/extensions/about.dtd
locale/en-US/mozapps/extensions/blocklist.dtd
locale/en-US/mozapps/extensions/errors.dtd
locale/en-US/mozapps/extensions/extensions.dtd
locale/en-US/mozapps/extensions/update.dtd
locale/en-US/mozapps/handling/handling.dtd
locale/en-US/mozapps/preferences/changemp.dtd
locale/en-US/mozapps/preferences/ocsp.dtd
locale/en-US/mozapps/preferences/removemp.dtd
locale/en-US/mozapps/profile/createProfileWizard.dtd
locale/en-US/mozapps/profile/profileSelection.dtd
locale/en-US/mozapps/update/history.dtd
locale/en-US/mozapps/update/incompatible.dtd
locale/en-US/mozapps/update/updates.dtd
locale/en-US/mozapps/xpinstall/xpinstallConfirm.dtd
locale/en-US/passwordmgr/passwordManager.dtd
locale/en-US/pippki/certManager.dtd
locale/en-US/pippki/deviceManager.dtd
locale/en-US/pippki/pippki.dtd
locale/en-US/pippki/validation.dtd

* Denotes a file forked by either Camino or Firefox for which strings from the corresponding .properties file from the l10n-mozilla1.9.2 repository cannot be used. This list is not yet complete.

Gecko .properties files

Bug 248160 and Bug 394105 enabled support for localizing Gecko .properties files in Camino 2. This added 36 new .strings files and hundreds of strings. Unfortunately, not all of these files are used—some of the files are for code not used at all by Camino, and some of the files are used by Camino, but the code that calls those strings does not work with the Gecko stringbundle override service, meaning localized versions of those files are ignored.

In order to eliminate useless strings for localizers, I have begun testing each file. The testing methodology is thus:

  1. Copy the English.lproj of a Camino 2pre build to French.lproj
    • N.B. It is also useful to use a build of Camino that adds a call to NSLog(tableName); just before the call to NSString* overrideStr = NSLocalizedStringFromTable(keyStr, tableName, nil); here, in order to determine if the stringbundle override service is telling us it wants to access one of our files
  2. Find one or more places that call the original Gecko .properties file (e.g., chrome://global/locale/dom/dom.properties) using MXR
    1. Examine the caller(s) and/or .properties file to determine if that code/those strings are used in Camino
    2. If the code/strings appear to be used, determine actions to perform to test the usage of the file
  3. Localize one or more strings in the .strings file
  4. Launch Camino with the French language active and perform the steps established in 2.2 above
  5. Check to see if the localized string from 3 above appears
    • If so, the file is used
    • If not, check the Console to see if a tableName was logged and the name matches the name of the .strings file you were testing
      • If there is no tableName, then the code that uses those strings ignores the stringbundle override service
      • If the tableName does not match, fix the name, test again, and file a bug to get the .strings file renamed if renaming the file allows the strings to be used

Camino 2.1

All of the _properties.strings files added by Camino 2 need to be audited to check for updates, and those files need to be updated.

find $HOME/Camino/dev/192branch/mozilla -name "*.properties" -path "*locale*" -not \( -path "*/browser/*" -or -path "*/testing/*" -or -path "*other-licenses*" -or -path "*/reporter/*" -or -path "*camino*" \) -print0 -exec hg log -l 1 {} \; | edit
will list all the locale properties files and list the information about the file’s last revision (note that this output may still contain a few extraneous files not contained in Camino’s en-US.jar).

In addition, the lists of files below needs to be compared against the existing _properties.strings files; any new files that are used in Camino will need to be added (and any removed files should be removed).

Unchecked files

Unchecked files, changed since Hg
Unchecked files, unchanged since Hg

not all were examined for Camino 2 because they weren't shipped

File used in Camino

Used in Camino 2, needs updates for Camino 2.1

Changes will be needed in the corresponding _properties.strings files in the repo!

locale/en-US/global/css.properties
locale/en-US/global/dom/dom.properties
locale/en-US/global/plugins.properties *
locale/en-US/pipnss/pipnss.properties

Used in Camino, new in Camino 2.1

New corresponding _properties.strings files will be needed in the repo!

locale/en-US/global/svg/svg.properties

File used in Camino but needs to be loaded via ChromeML in Camino 2.1

locale/en-US/global/security/caps.properties
locale/en-US/global/typeaheadfind.properties *

Used in Camino 2, unchanged since Hg

No changes are needed to these _properties.strings files in the repo!

locale/en-US/global-platform/mac/intl.properties
locale/en-US/global-region/region.properties (used by about:plugins)
locale/en-US/global/appstrings.properties **
locale/en-US/global/crashes.properties *
locale/en-US/global/layout_errors.properties
locale/en-US/global/layout/HtmlForm.properties
locale/en-US/global/layout/MediaDocument.properties
locale/en-US/global/layout/xmlparser.properties
locale/en-US/global/xslt/xslt.properties
locale/en-US/global/commonDialogs.properties
locale/en-US/global/config.properties
locale/en-US/global/prompts.properties
locale/en-US/necko/necko.properties
locale/en-US/pipnss/nsserrors.properties
locale/en-US/pipnss/security.properties

* Denotes a file forked by either Camino or Firefox for which strings from the corresponding .properties file from the l10n-mozilla1.9.2 repository cannot be used. This list is not yet complete.

** This file is forked, and its Camino _properties.strings file has been updated since 2.0 (for Offline Mode).

File not used in Camino

Unchanged since Hg, not used in Camino

locale/en-US/global-platform/mac/accessible.properties
locale/en-US/global-platform/unix/accessible.properties
locale/en-US/global-platform/win/accessible.properties
locale/en-US/global/global-strres.properties
locale/en-US/global/nsWebBrowserPersist.properties
locale/en-US/global/printdialog.properties (but Gecko 2 does)
locale/en-US/global/storage.properties
locale/en-US/global/webservices/security.properties
locale/en-US/autoconfig/autoconfig.properties
locale/en-US/global/finddialog.properties
locale/en-US/global/viewSource.properties
locale/en-US/global/wizard.properties
locale/en-US/global-platform/mac/platformKeys.properties
locale/en-US/global-platform/unix/platformKeys.properties
locale/en-US/global-platform/win/platformKeys.properties
locale/en-US/mozapps/extensions/update.properties
locale/en-US/mozapps/profile/profileSelection.properties
locale/en-US/global/console.properties
locale/en-US/global/downloadProgress.properties
locale/en-US/global/nsProgressDialog.properties
locale/en-US/alerts/notificationNames.properties
locale/en-US/global/printing.properties

File unused in Camino

locale/branding/brand.properties ***
locale/en-US/cookie/cookieAcceptDialog.properties
locale/en-US/global-platform/unix/intl.properties
locale/en-US/global-platform/win/intl.properties
locale/en-US/global/aboutRights.properties
locale/en-US/global/browser.properties
locale/en-US/global/charsetTitles.properties
locale/en-US/global/contentAreaCommands.properties
locale/en-US/global/customizeToolbar.properties
locale/en-US/global/dateFormat.properties ****
locale/en-US/global/dialog.properties
locale/en-US/global/filefield.properties
locale/en-US/global/filepicker.properties †
locale/en-US/global/findbar.properties
locale/en-US/global/gnomeprintdialog.properties
locale/en-US/global/intl.properties ††
locale/en-US/global/keys.properties
locale/en-US/global/languageNames.properties
locale/en-US/global/nsHelperAppDlg.properties
locale/en-US/global/regionNames.properties
locale/en-US/global/search/search.properties
locale/en-US/global/xbl.properties
locale/en-US/global/xul.properties †††
locale/en-US/global/xpinstall/xpinstall.properties
locale/en-US/mozapps/downloads/downloads.properties
locale/en-US/mozapps/downloads/unknownContentType.properties
locale/en-US/mozapps/extensions/extensions.properties
locale/en-US/mozapps/handling/handling.properties
locale/en-US/mozapps/plugins/plugins.properties
locale/en-US/mozapps/preferences/preferences.properties
locale/en-US/mozapps/update/updates.properties
locale/en-US/mozapps/xpinstall/xpinstallConfirm.properties
locale/en-US/passwordmgr/passwordmgr.properties
locale/en-US/pippki/pippki.properties
locale/en-US/places/places.properties

*** It's unclear if this file is used by Gecko, but in any event, it needs no translation (it’s also “forked”, so the Firefox version could not be used if it needed translation).

**** This file is internal to the Places NavHistory impl, but the strings it contains appear to only be used in Firefox UI.

† This file is possibly used to provide the “Save As:” title (and possibly error messages) anywhere an nsFilePicker is used with modeSave; it’s not clear where, if anywhere, this might happen in Gecko code called by Camino.

†† This is used internally by Gecko for the default accept-language and UI locale prefs, the default character detector, the pluralRule setting, and a bunch of Firefox UI settings. The first two we override (and fell back to the same defaults, when they lived in all.js before this file) and we have the character detector off (and use the universal one when switching it on). Nothing in Gecko UI currently uses the plural formatter.

††† This file does contain a couple of strings that could be shown as errors if certain vendor CSS is misused in content; however, the nsIStringBundleOverride doesn't work for this file, and it’s really not worth adding it to ChromeML for these rare errors.

Camino 2.0

See User:Sardisson/Localizing_Gecko_Strings for the lists of files examined for Camino 2.0.


sed+iconv rule from a Makefile for transforming the content of translated Core files and producing a UTF-16-encoded file (will not rename files):

sed -E -e "s/^#(.*)$$/\/\* #\1 \*\//" \
       -e 's/\"/\\\"/g' \
    -E -e "s/^([^\"#= ]*)([[:space:]]*)=([[:space:]]*)(.*)$$/\"\1\" = \"\4\";/" $< | \
iconv -f UTF-8 -t UTF-16 > $@

$< should be replaced by the input file and $@ by the output file.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox