Skip to content

CSSInfo macro incorrectly localizes transition-property initial value all #318

@yoshi389111

Description

@yoshi389111

Summary

On the transition-property
pages in localized versions (e.g., Japanese), the "Formal definition" → "Initial value" is shown as a localized word such as "すべて".

The CSSInfo macro currently uses localized data for the "initial value" (if such data is available).

https://github.com/mdn/yari/blob/79758309370250e2388821474edd9e5278aef5d1/kumascript/macros/CSSInfo.ejs#L168-L179

The keyword all is included in those localized data files (in mdn/data) and thus gets translated. However, all is a CSS keyword and should never be localized.

This affects all locales where all has been translated, not only Japanese.
At present, transition-property is the only CSS property whose initial value is all (link) , which is why this issue is limited to this property.

Initial values ​​and localization items

List of initial values ​​found in properties.json :

$ grep '"initial"' properties.json | sort -u
    "initial": "0",
    "initial": "0% 0%",
    "initial": "0%",
    "initial": "0.0",
    "initial": "0px 0px",
    "initial": "0px",
    "initial": "0s",
    "initial": "1",
    "initial": "100%",
    "initial": "1dppx",
    "initial": "1px",
    "initial": "2",
    "initial": "4",
    "initial": "400%",
    "initial": "50% 50% 0",
    "initial": "50% 50%",
    "initial": "8",
    "initial": "ButtonText",
    "initial": "Scrollbar",
    "initial": "ThreeDDarkShadow",
    "initial": "ThreeDFace",
    "initial": "ThreeDHighlight",
    "initial": "\"\"",
    "initial": "add",
    "initial": "all",
    "initial": "alpha",
    "initial": "alternate",
    "initial": "anchors-visible",
    "initial": "auto auto",
    "initial": "auto",
    "initial": "autoForSmartphoneBrowsersSupportingInflation",
    "initial": "balance",
    "initial": "baseline",
    "initial": "black",
    "initial": "block",
    "initial": "border",
    "initial": "border-box",
    "initial": "butt",
    "initial": "canvastext",
    "initial": "chained",
    "initial": "clip",
    "initial": "collapse",
    "initial": "content-box",
    "initial": "currentcolor",
    "initial": "default",
    "initial": "dependsOnUserAgent",
    "initial": "disc",
    "initial": "drag",
    "initial": "ease",
    "initial": "economy",
    "initial": "false",
    "initial": "fill",
    "initial": "fixed",
    "initial": "flat",
    "initial": "from-image",
    "initial": "grippers",
    "initial": "horizontal-tb",
    "initial": "inline",
    "initial": "inline-axis",
    "initial": "legacy",
    "initial": "linearRGB",
    "initial": "ltr",
    "initial": "luminance",
    "initial": "manual",
    "initial": "match-source",
    "initial": "medium",
    "initial": "miter",
    "initial": "mixed",
    "initial": "no-limit",
    "initial": "noPracticalInitialValue",
    "initial": "none",
    "initial": "noneButOverriddenInUserAgentCSS",
    "initial": "nonzero",
    "initial": "normal",
    "initial": "nowrap",
    "initial": "numeric-only",
    "initial": "objects",
    "initial": "outside",
    "initial": "pack",
    "initial": "padding",
    "initial": "padding-box",
    "initial": "railed",
    "initial": "read-only",
    "initial": "repeat",
    "initial": "replace",
    "initial": "row",
    "initial": "running",
    "initial": "scroll",
    "initial": "seeProse",
    "initial": "separate",
    "initial": "show",
    "initial": "single",
    "initial": "slice",
    "initial": "snapInterval(0%, 100%)",
    "initial": "snapInterval(0px, 100%)",
    "initial": "solid",
    "initial": "source-over",
    "initial": "space-around",
    "initial": "start",
    "initial": "startOrNamelessValueIfLTRRightIfRTL",
    "initial": "static",
    "initial": "stretch",
    "initial": "stretch-to-fit",
    "initial": "tb",
    "initial": "text",
    "initial": "top",
    "initial": "transparent",
    "initial": "view-box",
    "initial": "visible",
    "initial": "weight style small-caps position ",
    "initial": "white",
    "initial": "wrap",
    "initial": "zoomForTheTopLevelNoneForTheRest",
    "initial": [

List of initial values ​​that have localized strings in css.json :

  "\"\"": {
  "all": {
  "autoForSmartphoneBrowsersSupportingInflation": {
  "dependsOnUserAgent": {
  "noPracticalInitialValue": {
  "noneButOverriddenInUserAgentCSS": {
  "seeProse": {
  "startOrNamelessValueIfLTRRightIfRTL": {
  "zoomForTheTopLevelNoneForTheRest": {

Possible solutions

  • Preferred (macro fix): Adjust the CSSInfo macro to prevent localization of certain CSS keyword initial values (e.g., all ).
  • Alternative: Remove the localized entry for all from mdn/data , if it is confirmed safe to do so.

URL

https://developer.mozilla.org/de/docs/Web/CSS/transition
https://developer.mozilla.org/fr/docs/Web/CSS/transition
https://developer.mozilla.org/ja/docs/Web/CSS/transition
https://developer.mozilla.org/ru/docs/Web/CSS/transition
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transition

Reproduction steps

  1. Open a localized page for transition-property (e.g., Japanese).
  2. In the "Formal definition" section, check the "Initial value".
  3. It shows a localized string instead of the CSS keyword all.

Expected behavior

The "Initial value" for the transition-property is displayed as all.

Actual behavior

The "Initial value" for transition-property is display a localized string.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Windows

Screenshot

For the Japanese version:

Image

Anything else?

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1We will address this soon and will provide capacity from our team for it in the next few releases.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions