Firefox附加组件描述本地化

时间:2014-11-27 12:42:21

标签: firefox localization add-on

我创建了简单的无重启Firefox插件,并尝试对其进行本地化。我无法本地化附加组件名称和说明。我试图按照此处Localizing extension descriptions

进行描述

在我的install.rdf文件和package.json

下面

的package.json

{
    "name": "find_in_files",
    "title": "Find in files",    
    "id":  "{7DE613B7-54D9-4899-A018-861472402B2E}",
    "description": "Search for substring in files",
    "author": "Vitaly Shulgin",
    "license": "MPL 2.0",
    "version": "1.1",
    "unpack": "true",
    "preferences": [
        {
            "name": "SearchDirectory",
            "title": "Search directory",
            "description": "You must specify it before search. Please, be patient - it may takes some time to index documents before search will return correct result.",
            "type": "directory",
            "value": ""
        },
        {
            "name": "DefaultLocale",
            "title": "Default language",
            "description": "Default language to use when searching in non-unicode documents",
            "type": "menulist",
            "value": "ru-ru",
            "options": [
                {
                    "value": "en-us",
                    "label": "English"
                },
                {
                    "value": "ru-ru",
                    "label": "Russian"
                }
            ]
        },
        {
            "name": "OutputFileName",
            "title": "Temporary output file name",
            "description": "Temporary output file name",
            "type": "string",
            "value": "fif-result.html",
            "hidden": true
        }
    ]
}

的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>{7DE613B7-54D9-4899-A018-861472402B2E}</em:id>
    <!-- begin localizaation -->
     <em:localized>
      <Description>
        <em:locale>ru-Ru</em:locale>
        <em:name>Поиск в файлах</em:name>
        <em:description>Поиск выделенного текста в файлах</em:description>
      </Description>
    </em:localized>
    <em:localized>
      <Description>
        <em:locale>en-Us</em:locale>
        <em:name>Find in Files</em:name>
        <em:description>Search for selected text in files</em:description>         
      </Description>
    </em:localized>
    <!-- em:name>Find in files</em:name -->
    <!-- em:description>Search for selected text in files</em:description -->         
    <!-- end localizaation -->
    <em:version>1.1</em:version>
    <em:type>2</em:type>
    <em:targetApplication>
      <Description>
      <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!--Firefox-->
      <em:minVersion>1.5</em:minVersion>
      <em:maxVersion>3.0.*</em:maxVersion>
      </Description>
    </em:targetApplication>
    <em:unpack>true</em:unpack>  
    <em:creator>Vitaly A. Shulgin</em:creator>
    <em:targetPlatform>WINNT</em:targetPlatform>
  </Description>
</RDF>

我做错了什么?

1 个答案:

答案 0 :(得分:0)

答案是 - 命令&#34; cfx xpi&#34;从mozilla附加sdk将覆盖install.rdf,如果你在项目文件夹中。所以,为了让事情正常工作 - 创建xpi包,解压缩(解压缩) - 你会发现自动生成install.rdf(!!!),用自己的替换install.rdf并用zip命令重新打包xpi

总而言之,伙计们!

相关问题