Yes, better APIs for this is also on my fb-extension-developer wish-
list.

I have appended additional parameter to $STR and $STRF methods (R1623)
so a string bundle ID can be specified. If the parameter isn't
provided "strings_firebug" bundle is used by default.

Here is an example how to load a string from a custom string bundle:
$STR("firecookie.StaticLabel", "strings_firecookie");
$STRF("firecookie.DynamicLabel", [params], "strings_firecookie");

This should solve the problem of reusing these methods in a Firebug
extension.

In case of openPermissions method you could override it entirely in
your module and
modify following two lines as follows:
windowTitle: $STR(this.panelName + ".Permissions",
"strings_myExtension"),
introText: $STR(this.panelName + ".PermissionsIntro",
"strings_myExtension"),

We could also create a new getString method for Firebug.Module that
would be used to get localized strings. This method could be
overridden by custom modules in order to specify proper string bundle
(so you don't have to repeat the entire openPermissions method and
perhaps other in the future).

This is how the implementation would look like in openPermissions
method.
windowTitle: this.getString(this.panelName + ".Permissions",
"strings_myExtension"),
introText: this.getString(this.panelName + ".PermissionsIntro",
"strings_myExtension"),

And this is how default implementation of getString method would look
like:
getString: function (name)
{
    return $STR(name);
}

What do you think?
Honza


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to