Difference between revisions of "User:Sardisson/Localizing Gecko Strings"
(→File works: can't use fx copy) |
(→Gecko <code>.properties</code> files: note removed ones) |
||
(32 intermediate revisions by 3 users not shown) | |||
Line 18: | Line 18: | ||
#* If not, check the Console to see if a <code>tableName</code> was logged and the name matches the name of the <code>.strings</code> file you were testing | #* If not, check the Console to see if a <code>tableName</code> was logged and the name matches the name of the <code>.strings</code> file you were testing | ||
#** If there is no <code>tableName</code>, then the code that uses those strings ignores the stringbundle override service | #** If there is no <code>tableName</code>, then the code that uses those strings ignores the stringbundle override service | ||
− | #** If the <code>tableName</code> does not match, fix the name, test again, and file a bug to get the <code>.strings</code> file renamed | + | #** If the <code>tableName</code> does not match, fix the name, test again, and file a bug to get the <code>.strings</code> file renamed if renaming the file allows the strings to be used |
===Untested files=== | ===Untested files=== | ||
+ | Zarro! | ||
+ | |||
+ | ===File works=== | ||
+ | global-platform_locale_intl_properties.strings (new to GECKO_STRINGS in b4)<br /> | ||
+ | global-region_locale_region_properties.strings *<br /> | ||
+ | global_locale_appstrings_properties.strings *<br /> | ||
+ | global_locale_commonDialogs_properties.strings<br /> | ||
+ | global_locale_config_properties.strings *<br /> | ||
+ | global_locale_crashes_properties.strings *<br /> | ||
+ | global_locale_css_properties.strings<br /> | ||
global_locale_dom_dom_properties.strings<br /> | global_locale_dom_dom_properties.strings<br /> | ||
− | + | global_locale_layout_errors_properties.strings<br /> | |
− | |||
global_locale_layout_HtmlForm_properties.strings<br /> | global_locale_layout_HtmlForm_properties.strings<br /> | ||
global_locale_layout_MediaDocument_properties.strings<br /> | global_locale_layout_MediaDocument_properties.strings<br /> | ||
− | |||
global_locale_layout_xmlparser_properties.strings<br /> | global_locale_layout_xmlparser_properties.strings<br /> | ||
− | |||
− | |||
− | |||
− | |||
global_locale_plugins_properties.strings<br /> | global_locale_plugins_properties.strings<br /> | ||
− | |||
− | |||
− | |||
global_locale_prompts_properties.strings<br /> | global_locale_prompts_properties.strings<br /> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
global_locale_xslt_xslt_properties.strings<br /> | global_locale_xslt_xslt_properties.strings<br /> | ||
− | + | necko_locale_necko_properties.strings<br /> | |
− | + | pipnss_locale_pipnss_properties.strings<br /> | |
pipnss_locale_nsserrors_properties.strings<br /> | pipnss_locale_nsserrors_properties.strings<br /> | ||
− | |||
pipnss_locale_security_properties.strings<br /> | pipnss_locale_security_properties.strings<br /> | ||
− | + | ===File used in Camino but calling code ignores <code>nsIStringBundleOverride</code>, removed in b4=== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ===File used in Camino but calling code ignores <code>nsIStringBundleOverride</code>=== | ||
communicator_locale_typeaheadfind_properties.strings *<br /> | communicator_locale_typeaheadfind_properties.strings *<br /> | ||
− | + | global_locale_security_caps_properties.strings<br /> | |
− | ===File unused in Camino, | + | ===File unused in Camino, removed in b4=== |
global_locale_charsetTitles_properties.strings<br /> | global_locale_charsetTitles_properties.strings<br /> | ||
global_locale_dialog_properties.strings<br /> | global_locale_dialog_properties.strings<br /> | ||
+ | global_locale_global-strres_properties.strings<br /> | ||
global_locale_keys_properties.strings<br /> | global_locale_keys_properties.strings<br /> | ||
+ | global_locale_languageNames_properties.strings<br /> | ||
+ | global_locale_nsHelperAppDlg_properties.strings<br /> | ||
+ | global_locale_nsProgressDialog_properties.strings<br /> | ||
+ | global_locale_nsTreeSorting_properties.strings<br /> | ||
+ | global_locale_nsWebBrowserPersist_properties.strings<br /> | ||
+ | global_locale_printdialog_properties.strings<br /> | ||
+ | global_locale_printing_properties.strings<br /> | ||
+ | global_locale_printPageSetup_properties.strings<br /> | ||
+ | global_locale_regionNames_properties.strings<br /> | ||
+ | global_locale_storage_properties.strings<br /> | ||
+ | global_locale_tabbrowser_properties.strings<br /> | ||
+ | global_locale_xul_properties.strings (may be used, but only for XUL error messages logged to console)<br /> | ||
+ | global_locale_xbl_properties.strings (may be used, but only for XUL error messages logged to console)<br /> | ||
+ | |||
+ | <nowiki>*</nowiki> Denotes a file forked by either Camino or Firefox for which strings from the corresponding <code>.properties</code> file from the [http://mxr.mozilla.org/l10n/ l10n repository] '''cannot''' be used. ''This list is not yet complete.'' | ||
+ | :For <code>global_locale_appstrings_properties.strings</code>, the text from <code>appstrings.properties</code> in <code>dom/locales/</code> can be used, but text from the version in <code>browser/locales/</code> '''must not be used'''. | ||
− | + | <code>sed</code>+<code>iconv</code> rule from a Makefile for transforming the content of translated Core files and producing a UTF-16-encoded file (will not rename files): | |
+ | <pre><nowiki>sed -E -e "s/^#(.*)$$/\/\* #\1 \*\//" \ | ||
+ | -e 's/\"/\\\"/g' \ | ||
+ | -E -e "s/^([^\"#= ]*)([[:space:]]*)=([[:space:]]*)(.*)$$/\"\1\" = \"\4\";/" $< | \ | ||
+ | iconv -f UTF-8 -t UTF-16 > $@</nowiki></pre> | ||
+ | <code>$<</code> should be replaced by the input file and <code>$@</code> by the output file. | ||
==Gecko <code>.dtd</code> files== | ==Gecko <code>.dtd</code> files== | ||
There is currently no way to localize Gecko <code>.dtd</code> files within Camino; see {{bug|457290}}. | There is currently no way to localize Gecko <code>.dtd</code> files within Camino; see {{bug|457290}}. |
Latest revision as of 20:17, 3 October 2009
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.
Contents
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:
- Copy the
English.lproj
of a Camino 2pre build toFrench.lproj
- N.B. It is also useful to use a build of Camino that adds a call to
NSLog(tableName);
just before the call toNSString* 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
- N.B. It is also useful to use a build of Camino that adds a call to
- Find one or more places that call the original Gecko
.properties
file (e.g.,chrome://global/locale/dom/dom.properties
) using MXR- Examine the caller(s) and/or
.properties
file to determine if that code/those strings are used in Camino - If the code/strings appear to be used, determine actions to perform to test the usage of the file
- Examine the caller(s) and/or
- Localize one or more strings in the
.strings
file - Launch Camino with the French language active and perform the steps established in 2.2 above
- 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
- If there is no
Untested files
Zarro!
File works
global-platform_locale_intl_properties.strings (new to GECKO_STRINGS in b4)
global-region_locale_region_properties.strings *
global_locale_appstrings_properties.strings *
global_locale_commonDialogs_properties.strings
global_locale_config_properties.strings *
global_locale_crashes_properties.strings *
global_locale_css_properties.strings
global_locale_dom_dom_properties.strings
global_locale_layout_errors_properties.strings
global_locale_layout_HtmlForm_properties.strings
global_locale_layout_MediaDocument_properties.strings
global_locale_layout_xmlparser_properties.strings
global_locale_plugins_properties.strings
global_locale_prompts_properties.strings
global_locale_xslt_xslt_properties.strings
necko_locale_necko_properties.strings
pipnss_locale_pipnss_properties.strings
pipnss_locale_nsserrors_properties.strings
pipnss_locale_security_properties.strings
File used in Camino but calling code ignores nsIStringBundleOverride
, removed in b4
communicator_locale_typeaheadfind_properties.strings *
global_locale_security_caps_properties.strings
File unused in Camino, removed in b4
global_locale_charsetTitles_properties.strings
global_locale_dialog_properties.strings
global_locale_global-strres_properties.strings
global_locale_keys_properties.strings
global_locale_languageNames_properties.strings
global_locale_nsHelperAppDlg_properties.strings
global_locale_nsProgressDialog_properties.strings
global_locale_nsTreeSorting_properties.strings
global_locale_nsWebBrowserPersist_properties.strings
global_locale_printdialog_properties.strings
global_locale_printing_properties.strings
global_locale_printPageSetup_properties.strings
global_locale_regionNames_properties.strings
global_locale_storage_properties.strings
global_locale_tabbrowser_properties.strings
global_locale_xul_properties.strings (may be used, but only for XUL error messages logged to console)
global_locale_xbl_properties.strings (may be used, but only for XUL error messages logged to console)
* 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 fromappstrings.properties
indom/locales/
can be used, but text from the version inbrowser/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.