nsIStringBundleOverride 编辑

intl/strres/public/nsIStringBundleOverride.idlScriptable Provides the string bundle override service; this interface is an implementation detail. You should never need to use it directly. Inherits from: nsISupports Last changed in Gecko 1.7

Implemented by: @mozilla.org/intl/stringbundle/text-override;1. To create an instance, use:

var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle/text-override;1"]
                                    .getService(Components.interfaces.nsIStringBundleOverride);
Note: You should never need to use this service directly. Instead, the string bundle service will automatically try to load this service. If there is no custom-strings.txt file then the service will fail to load.

Method overview

nsISimpleEnumerator enumerateKeysInBundle(in AUTF8String url);
AString getStringFromName(in AUTF8String url, in ACString key);

Methods

enumerateKeysInBundle()

Get all override keys for a given string bundle.

nsISimpleEnumerator enumerateKeysInBundle(
  in AUTF8String url
);
Parameters
url
The URL of the original string bundle whose keys are to be overridden.
Return value

An enumeration of nsIPropertyElement objects for the keys that are overridden in the given string bundle. Note that these keys may not exist in the original string bundle.

getStringFromName()

Get the override value for a particular key in a particular string bundle.

AString getStringFromName(
  in AUTF8String url,
  in ACString key
);
Parameters
url
The URL of the original string bundle whose keys are to be overridden.
key
The key to be overridden.
Return value

The override value. An exception is thrown if the key has not been overridden. However, no exception is thrown if the original string bundle did not have the key.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:47 次

字数:3292

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文