【问题标题】:Localizing extension descriptions before Gecko 1.9在 Gecko 1.9 之前本地化扩展描述
【发布时间】:2011-01-17 13:04:00
【问题描述】:

我正在尝试根据来自 https://developer.mozilla.org/en/Localizing_extension_descriptions 的信息(在 Gecko 1.9 之前本地化)使用本地化名称为 Firefox 构建扩展,但它不起作用。浏览器 Javascript 控制台中的错误是:

Błąd:[异常...“组件返回失败代码:0x80004003(NS_ERROR_INVALID_POINTER)[nsIRDFService.GetLiteral]”nsresult:“0x80004003(NS_ERROR_INVALID_POINTER)”位置:“JS 框架 :: file:///C:/Program%20Files/ Mozilla%20Firefox%201.5/components/nsExtensionManager.js :: EM_L :: line 225" 数据:无] Plik źródłowy:file:///C:/Program%20Files/Mozilla%20Firefox%201.5/components/nsExtensionManager.js 维尔斯:225

我的扩展文件层次结构是:

gemgecko.xpi: /安装.rdf /components/gemgecko.dll /defaults/preferences/prefs.js /chrome.manifest /chrome/locale/pl/install.properties /chrome/locale/en/install.properties

/defaults/preferences/prefs.js:

pref("extensions.gemgecko@gemius.pl.name", "chrome://gemgecko/locale/en/install.properties");

/chrome/locale/en/install.properties:

extensions.gemgecko@gemius.pl.name=gemiusAudience 研究

/chrome/locale/pl/install.properties:

extensions.gemgecko@gemius.pl.name=Badanie Megapanel PBI/Gemius

谁能帮我找出我的扩展程序中的错误?

编辑

我正在添加安装清单...

/install.rdf:

<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
    <em:id>gemgecko@gemius.pl</em:id>
    <em:version>2.01</em:version>
    <em:name>nazwa</em:name>
    <em:creator>tworca</em:creator>
    <em:description>opis</em:description>
    <em:homepageURL>http://www.test.pl</em:homepageURL>

    <em:targetApplication>
        <Description>
            <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
            <em:minVersion>1.5.0</em:minVersion>
            <em:maxVersion>*</em:maxVersion>
        </Description>
    </em:targetApplication>

</Description>

</RDF>

我已经在 Firefox 1.5 和 3.6 上对其进行了测试。在 3.6 上似乎一切正常,但在 1.5 上却不行 - 扩展管理器显示来自 install.rdf 的扩展名,而不是来自 chrome://gemgecko/locale/install.properties...

【问题讨论】:

  • 您也可以发布您的 chrome.manifest,但我认为 Neil 是正确的。
  • chrome.manifest: binary-component components/gemgecko4.dll appversion>=4.-1 binary-component components/gemgecko.dll appversion=4.-1

标签: localization firefox-addon gecko


【解决方案1】:

chrome://gemgecko/locale/en/install.properties 对我来说似乎是错误的,/en/ 不是 chrome: URL 的一部分,它在 chrome: URL 转换时被替换。

编辑:

我在您的 chrome.manifest 中没有看到任何 chrome registration 条目。它们应该看起来像这样:

locale gemgecko pl chrome/locale/pl
locale gemgecko en chrome/locale/en

【讨论】:

  • 你能在浏览器中打开chrome://gemgecko/locale/install.properties,它会显示extensions.gemgecko@gemius.pl.name=gemiusAudience study吗?如果可以,你能在about:config中找到偏好,它是否也能正确显示gemiusAudience study?跨度>
  • 如果无法在浏览器中打开 .properties 文件则
  • 好的,我已经更正了 chrome.manifest 和 pref.js。现在当我打开chrome://gemgecko/locale/install.properties 时浏览器显示文件内容并且about:config 中的值是正确的。但是扩展管理器会显示 install.rdf 中的扩展名(当文件包含它时),或者不加载扩展名(当 install.rdf 文件不包含 name 字段时)。
  • 是的,如果install.rdf 文件不包含&lt;em:name&gt;&lt;/em:name&gt;(并且未加载扩展名)。当该字段出现在安装清单中时,扩展管理器会显示来自 install.rdf 而不是来自 chrome://gemgecko/locale/install.properties 的扩展名称。
  • 我在您已发布的文件中看不到任何错误。你介意也发布你的 install.rdf,以防万一那里出现问题吗?
猜你喜欢
  • 2018-09-26
  • 2013-06-14
  • 2014-04-15
  • 2015-01-26
  • 2012-03-25
  • 1970-01-01
  • 2013-06-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多