Closed Bug 1325252 Opened 7 years ago Closed 4 years ago

i18n documentation meanders, doesn't clearly state where messages can and can't be used.

Categories

(Developer Documentation Graveyard :: Localization, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Leif.AMO, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

The documentation meanders in its description of what files can and can't directly make use of __MSG_property__ to retrieve "property" from messages.json.

It needs to be more clearly described at the beginning, before anything else, that the i18n messages stored in messages.json can only be accessed from manifest.json, background and content scripts, and CSS.  Specifically, they can NOT be retrieved into the context of a page (content, options_ui, background, etc).

I do not know if this is a bug (unable to use __MSG_*__ in HTML pages), or if this is by design.  As such, the only way to inject an i18n message from messages.json is to retrieve it from a JS file and inject it into a specific element (i.e. finding node in DOM tree, setting innerHTML), or perhaps by defining a CSS element (title, h1#title, etc { background: url("images/__MSG_property__.jpg"; } ), or something like that.  Both of these examples should also be put into the i18n example.

I am still learning and trying to get it working, no code to submit yet.
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.