Closed Bug 11097 Opened 25 years ago Closed 25 years ago

Move localizable strings from UI JavaScript files into string bundle: Editor.properties

Categories

(Core :: DOM: Editor, defect, P3)

All
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: cmanske, Assigned: cmanske)

Details

Dynamic text used in the Editor UI must get strings from a localizable
source. This will be in the Editor.properties string bundle file and we should
use the JS helpers developed by Tao. Here's his instructions:

I had checked in the needed functionality for retrieving external resources in
JS function. To save you a few effort, I also checked in a convinient
function, JS_GetStrBundle(chrome_url_to_the_property_file, app_locale),
which returns a JS nsIStringBundle object. For now, the second argument,
'app_locale', shall be null since you can get hold of the application locale
from JS functions yet. I will fix it when nsILocale is xpconnected.

You can call this object's member functions, GetStringFromID() and
GetStringFromName(), to retrieve texts from *.properties files just like
the way you do in C++ code.

To use this JS_ fucntion, you need to have the following line in your
XUL files before its usage:

<html:script language="javascript" src="chrome://global/content/strres.js" />

Known bugs:
The property file loader does not properly interpret escape unicode which
will cause non-ascii characters not render correctly in the UI.
We are working on this. english texts shall be drawn fine.
A sample JS function is provided at the end of this message. Feel free
to let me know if you have any question or comment.
Status: NEW → ASSIGNED
Target Milestone: M10
If there's a rush to do this while I'm on vacation (8/7 - 8/19), Simon or Kathy
can jump in and do this.
Target Milestone: M10 → M12
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
All of the editor UI strings in JavaScript have been place in editor.properties.
We have a GetString() method in the editor IDL that can be used in our JS for
accessing strings (we always use the "name" strategy, not ID).
Thanks for supplying the JS helpers, but we needed string bundle access in
the editor shell, so it was trivial to allow it to be used in JS as well.
Charley can you verify this and mark verified-fixed? thanks!
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Boy was that tedious!
I found some strings in the image and link dialogs that need to be moved into
the editor.properties dialog.
Waiting for approval to check in fixes for those.
Status: REOPENED → ASSIGNED
Target Milestone: M12 → M11
I'd like to get this in ASAP for I18N folks.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Checked in 9/30.
Status: RESOLVED → VERIFIED
I've verified this now (which is how I found the last remaining strings
and had to reopen it!)
You need to log in before you can comment on or make changes to this bug.