Closed Bug 1434415 Opened 3 years ago Closed 3 years ago

Move all hard-coded PaymentRequest strings to localization files


(Firefox :: WebPayments UI, enhancement, P1)




Firefox 60
Tracking Status
firefox60 --- fixed


(Reporter: MattN, Assigned: jaws)


(Whiteboard: [webpayments])


(1 file)

While bootstrapping and figuring out what l10n files to use we hard-coded English strings. Now that we know we won't use l20n (since it doesn't support unprivileged content pages yet), we should convert our hard-coded strings to DTD/properties.

I think DTD should be usable directly from our resource URIs. Otherwise we can send the all strings from the parent process (read from .properties) at dialog load time.
Priority: P2 → P1
Assignee: nobody → jaws
Comment on attachment 8951424 [details]
Bug 1434415 - Move all hard-coded PaymentRequest strings to localization files.

I can look more tomorrow

::: toolkit/locales/
(Diff revision 1)
>    locale/@AB_CD@/alerts/alert.dtd                                (%chrome/alerts/alert.dtd)
>    locale/@AB_CD@/alerts/                         (%chrome/alerts/
> +% locale autoconfig @AB_CD@ %locale/@AB_CD@/autoconfig/
> +  locale/@AB_CD@/autoconfig/   (%chrome/autoconfig/
> +% locale payments @AB_CD@ %locale/@AB_CD@/payments/
> +  locale/@AB_CD@/payments/paymentRequest.dtd                     (%chrome/payments/paymentRequest.dtd)

Can you talk to someone on l10n to figure out how to opt us out of translation until we're ready  That way we are free to change strings
Flod, what is the process to answer comment #2?
Flags: needinfo?(francesco.lodolo)
Right now you're putting strings in toolkit/locales/en-US/chrome/payments, which means they will be picked up automatically by localization.

The solution is to put them outside of toolkit/locales/en-US (e.g. e.g. toolkit/components/payments/locale), but I need to redirect the NI to pike though, since I'm lost when it comes to jar and chrome://
Flags: needinfo?(francesco.lodolo) → needinfo?(l10n)
Yeah, just load the DTD and properties files from chrome://payments/content for now, and once you're ready, move the file to locales/en-US.

That said. Are you the first guys to try to create localizable web componenents in-tree? We should talk about how to do that. We don't know that yet either, and it'd be really sad if we hacked something that is copied a dozen of times, and we figure out afterwards that there's a better way.
Flags: needinfo?(l10n)
If we solved bug 1407418, we could also use Fluent here.
Comment on attachment 8951424 [details]
Bug 1434415 - Move all hard-coded PaymentRequest strings to localization files.

::: toolkit/components/payments/content/paymentDialogWrapper.js:334
(Diff revision 1)
> +    // Load strings here that need to be passed to unprivileged code.
> +    let strings = {
> +      "SecurityCodeInputPlaceholder": bundle.GetStringFromName("SecurityCodeInputPlaceholder"),
> +    };
> +

I don't think Fx strings should go in the state since they're static and arguably not part of the application state. It would be nice to just use DTD for now so I would just delete the placeholder text and revert the properties usage. We'll probably move to Fluent before we really need .properties-like support.

::: toolkit/components/payments/res/paymentRequest.xhtml:6
(Diff revision 1)
> +  <!ENTITY % htmlDTD
> +    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> +    "DTD/xhtml1-strict.dtd">
> +  %htmlDTD;

Is the htmlDTD necessary?

::: toolkit/locales/
(Diff revision 1)
>    locale/@AB_CD@/mozapps/preferences/changemp.dtd                 (%chrome/mozapps/preferences/changemp.dtd)
>    locale/@AB_CD@/mozapps/preferences/removemp.dtd                 (%chrome/mozapps/preferences/removemp.dtd)
>    locale/@AB_CD@/mozapps/preferences/       (%chrome/mozapps/preferences/
>    locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd          (%chrome/mozapps/profile/createProfileWizard.dtd)
>    locale/@AB_CD@/mozapps/profile/      (%chrome/mozapps/profile/
>    locale/@AB_CD@/mozapps/profile/profileSelection.dtd             (%chrome/mozapps/profile/profileSelection.dtd)

Revert this with the move to `content`
Attachment #8951424 - Flags: review?(MattN+bmo) → review+
Pushed by
Move all hard-coded PaymentRequest strings to localization files. r=MattN
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Whiteboard: [webpayments]
Product: Toolkit → Firefox
Target Milestone: mozilla60 → Firefox 60
You need to log in before you can comment on or make changes to this bug.