User:Sardisson/Localizing Gecko Strings

From Camino Wiki
Jump to navigation Jump to search

Right now, only some of the strings used by Gecko are exposed to our localizers. For more details on this, see Bug 248160, Bug 394105, and Bug 457290.

Gecko .properties files

Bug 248160 and Bug 394105 enabled support for localizing Gecko .properties files in Camino. 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

Untested files

global-region_locale_region_properties.strings
global_locale_dom_dom_properties.strings
global_locale_global-strres_properties.strings
global_locale_layout_errors_properties.strings
global_locale_layout_MediaDocument_properties.strings
global_locale_layout_xmlparser_properties.strings
global_locale_nsHelperAppDlg_properties.strings
global_locale_nsWebBrowserPersist_properties.strings
global_locale_printing_properties.strings
global_locale_security_caps_properties.strings
global_locale_xbl_properties.strings
global_locale_xslt_xslt_properties.strings
global_locale_xul_properties.strings
pipnss_locale_nsserrors_properties.strings
pipnss_locale_pipnss_properties.strings
pipnss_locale_security_properties.strings

File works

global_locale_appstrings_properties.strings *
global_locale_commonDialogs_properties.strings
global_locale_config_properties.strings *
global_locale_crashes_properties.strings *
global_locale_plugins_properties.strings
global_locale_prompts_properties.strings
necko_locale_necko_properties.strings

File used in Camino but calling code ignores nsIStringBundleOverride

communicator_locale_typeaheadfind_properties.strings *
global_locale_css_properties.strings

File unused in Camino, can be removed

global_locale_charsetTitles_properties.strings
global_locale_dialog_properties.strings
global_locale_keys_properties.strings
global_locale_languageNames_properties.strings
global_locale_nsProgressDialog_properties.strings
global_locale_nsTreeSorting_properties.strings
global_locale_printdialog_properties.strings
global_locale_printPageSetup_properties.strings
global_locale_regionNames_properties.strings
global_locale_storage_properties.strings
global_locale_tabbrowser_properties.strings

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

For global_locale_appstrings_properties.strings, the text from appstrings.properties in dom/locales/ can be used, but text from the version in browser/locales/ must not be used.


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.

Gecko .dtd files

There is currently no way to localize Gecko .dtd files within Camino; see Bug 457290.