Automatically localize all string properties in manifest.json

RESOLVED FIXED in Firefox 47

Status

()

Toolkit
WebExtensions: Untriaged
P2
normal
RESOLVED FIXED
2 years ago
18 hours ago

People

(Reporter: billm, Assigned: kmag)

Tracking

({dev-doc-complete})

unspecified
mozilla47
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
blocking-webextensions +

Firefox Tracking Flags

(firefox47 fixed)

Details

(Whiteboard: triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
This is a follow-up for bug 1197422.

Updated

2 years ago
Blocks: 1214433

Updated

2 years ago
Flags: blocking-webextensions+
(Assignee)

Updated

2 years ago
Assignee: nobody → kmaglione+bmo
Iteration: --- → 45.1 - Nov 16

Updated

2 years ago
Iteration: 45.1 - Nov 16 → 45.2 - Nov 30
(Assignee)

Updated

2 years ago
Depends on: 1225715

Updated

2 years ago
Iteration: 45.2 - Nov 30 → 45.3 - Dec 14

Updated

a year ago
Whiteboard: triaged

Updated

a year ago
Priority: -- → P2
(Assignee)

Updated

a year ago
Iteration: 45.3 - Dec 14 → 47.3 - Mar 7
(Assignee)

Comment 1

a year ago
Created attachment 8724319 [details]
MozReview Request: Bug 1214955: [webext] Automatically localize all localizable manifest properties. r?billm

Review commit: https://reviewboard.mozilla.org/r/36975/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/36975/
Attachment #8724319 - Flags: review?(wmccloskey)
(Reporter)

Comment 2

a year ago
Comment on attachment 8724319 [details]
MozReview Request: Bug 1214955: [webext] Automatically localize all localizable manifest properties. r?billm

https://reviewboard.mozilla.org/r/36975/#review33795

::: browser/components/extensions/schemas/browser_action.json:20
(Diff revision 1)
> +              "default_icon": {

Don't you want this to be localized?

::: browser/components/extensions/schemas/page_action.json:20
(Diff revision 1)
> +              "default_icon": {

Don't you want this to be localized?

::: toolkit/components/extensions/Extension.jsm:658
(Diff revision 1)
> +        preprocessors: {},

How about we always add "localize" to preprocessors, but it's the identity function if we don't have locale data?

::: toolkit/components/extensions/Schemas.jsm:281
(Diff revision 1)
> +  preprocess(value, context) {

Please extend the XPCShell test to test preprocessor stuff.

::: toolkit/components/extensions/Schemas.jsm:282
(Diff revision 1)
> +    if (this.preprocessor in context.preprocessors) {

This seems prone to error. I'd rather we throw an exception if this.preprocessor is defined and it's not in context.preprocessors. How about just |if (this.preprocessor)|?
Attachment #8724319 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 3

a year ago
https://reviewboard.mozilla.org/r/36975/#review33795

> Don't you want this to be localized?

I'm not sure. I was originally planning to, but Chrome doesn't localize icon properties, and we don't localize extension icons in either kind of install manifest, so I decided to skip it.

> This seems prone to error. I'd rather we throw an exception if this.preprocessor is defined and it's not in context.preprocessors. How about just |if (this.preprocessor)|?

Yeah, that makes sense.
(Assignee)

Comment 4

a year ago
https://hg.mozilla.org/integration/fx-team/rev/4c924e5c274980190d1e897fd2fd8cc3c87da0f0
Bug 1214955: [webext] Automatically localize all localizable manifest properties. r=billm

Comment 5

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/4c924e5c2749
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox47: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
(Assignee)

Comment 6

a year ago
I'm not sure what the best way to document these is. Perhaps some kind of inline tag to indicate properties that are localized, similar to the [optional] tag?

The following properties currently support localization:

name
short_name
description
creator
homepage_url
browser_action.default_title
browser_action.default_popup
page_action.default_title
page_action.default_popup
Keywords: dev-doc-needed

Updated

10 months ago
Depends on: 1295894
I've added a note in the docs page for every manifest key that has "preprocess": "localize" in its schema entry.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.