Closed Bug 1643390 Opened 4 years ago Closed 4 years ago

Input type=date placeholder text is not localized in Swedish

Categories

(Mozilla Localizations :: sv-SE / Swedish, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: eldmannen+mozilla, Assigned: droidbittin)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

I created a a input element with the type attribute set to "date". No value attribute specified.
<input type="date">

My Firefox is set to the Swedish locale.

Actual results:

Firefox rendered the input widget with a default placeholder of "YYYY-MM-DD".

Expected results:

The input widget should say "ÅÅÅÅ-MM-DD", since my Firefox locale is Swedish, not English.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

The severity field is not set for this bug.
:hiro, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(hikezoe.birchill)

Hmm, there's some localization code here.

Zibi, do you know why that may not be working as expected? Maybe the datetimebox should use a wider set of locales than the "web-exposed" locale list?

Reporter, do you know if this worked on a previous Firefox version? Maybe it's a regression in our localization code somehow.

Flags: needinfo?(gandalf)

Do we localize placeholders at all?

Flags: needinfo?(gandalf)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Reporter, do you know if this worked on a previous Firefox version? Maybe it's a regression in our localization code somehow.

No, I don't know if this has ever worked previously in any previous version of Firefox.

(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #4)

Do we localize placeholders at all?

Yes: https://searchfox.org/mozilla-central/rev/1304678d837c17811617754fd446794b774afe94/toolkit/content/widgets/datetimebox.js#167-207

Summary: Input type=date is not localized → Input type=date placeholder text is not localized

I think this is a localization issue for the Swedish locale. These strings are probably not properly localized in Swedish. I just tried with a Spanish Nightly, for example, and they're properly localized there.

Francesco, do you know what the right component for this is?

Flags: needinfo?(hikezoe.birchill) → needinfo?(francesco.lodolo)
Summary: Input type=date placeholder text is not localized → Input type=date placeholder text is not localized in Swedish

Either that, or "getWebExposedLocales" is not returning swedish for some reason of course... Reporter, if you enable the browser toolbox as described here, then move to the Console tab, what does getWebExposedLocales() return for you?

For example, for me it returns [ "es-ES", "en-US" ] in an Spanish localized Nightly.

Flags: needinfo?(eldmannen+mozilla)

Bugs for Swedish would go in Mozilla Localizations :: sv-SE / Swedish.
https://hg.mozilla.org/l10n-central/sv-SE/file/default/toolkit/chrome/global/datetimebox.dtd#l23

To test, just type data:text/html,<input type="date"/> in the address bar.

On a side note, if the placeholder comes from locales, we might get in confusing state when OS and Firefox locale don't match.

Status: UNCONFIRMED → NEW
Component: Layout: Form Controls → sv-SE / Swedish
Ever confirmed: true
Flags: needinfo?(francesco.lodolo)
Product: Core → Mozilla Localizations
QA Contact: slicedlime
Version: 77 Branch → unspecified

Same problem in Firefox 78 Beta 9 on Manjaro and changed it on Pontoon to åååå as Microsoft uses that too and its more correct for Swedish
so anyone feel like merging or changing this in the code and closing this bug ?

Assignee: nobody → droidbittin

There is nothing to merge. Unfortunately too late for 78. This will ride the trains with 79 at this point, and should be in tomorrow's Nightly.
https://hg.mozilla.org/l10n-central/sv-SE/rev/c4bb054a08dca7819ff828b04f604e4d5ad966c3

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)

Either that, or "getWebExposedLocales" is not returning swedish for some reason of course... Reporter, if you enable the browser toolbox as described here, then move to the Console tab, what does getWebExposedLocales() return for you?

It returns:
Array [ "sv-SE" ]

(In reply to Luna Jernberg from comment #10)

so anyone feel like merging or changing this in the code and closing this bug ?

Thanks for fixing it!

(In reply to Francesco Lodolo [:flod] from comment #11)

There is nothing to merge. Unfortunately too late for 78. This will ride the trains with 79 at this point, and should be in tomorrow's Nightly.

Oh, that's a long time to wait for such a trivial fix.

Flags: needinfo?(eldmannen+mozilla)
You need to log in before you can comment on or make changes to this bug.