mate64
mate64

Reputation: 10082

How to insert localized meta-tags from provided language files?

I wonder if there exists another solution, to insert localized extension meta-tags automatically without adding them manually to install.rdf, for example by using a language variable (see example below):

example: myextension/chrome/locale/ru-RU/install.dtd

mylang.description=example description

my install.rdf:

<em:localized>
  <Description>
    <em:locale>ru-RU</em:locale>
    <em:description>&mylang.description;</em:description> //<-- inpossible?
  </Description>
</em:localized>

or by a method, that automatically overwrites the standard install.rdf's <description>-tag with the user's language (from a file provided in myextension/chrome/locale/[LANG]/* ?


background:

so far, we've translated the <description>-tag (and sometimes the <name>-tag too) for more than 20 languages - i'm just looking for a way, to manage this tangle inside my install.rdf...

Upvotes: 0

Views: 162

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57681

You can provide localized descriptions via a localized preference pointing to a .properties file in your locale directory, see Localizing before Gecko 1.9 (this approach is still supported despite the article title). However, this approach has the disadvantage that the descriptions are only available if the extension is enabled - if the user disables your extension only the description from install.rdf will show up. Which is why I prefer using build scripts that will generate localization info in install.rdf from files in the locale directory.

Upvotes: 1

Related Questions