Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions components/compat-table/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,18 +738,27 @@ export class MDNCompatTable extends L10nMixin(LitElement) {

if (item.flags) {
for (const { type, name, value_to_set } of item.flags) {
const hasAdded =
typeof item.version_added === "string" &&
item.version_added !== "preview";
const hasLast = typeof item.version_last === "string";

const versionRange = hasAdded
? hasLast
? "range"
: "from"
: hasLast
? "until"
: "none";
Comment thread
nmleuz marked this conversation as resolved.
Outdated

supportNotes.push({
iconName: "disabled",
label: this.l10n.raw({
id: "compat-support-flags",
args: {
has_added: Number(
typeof item.version_added === "string" &&
item.version_added !== "preview",
),
version_range: versionRange,
Comment thread
LeoMcA marked this conversation as resolved.
version_added: item.version_added,
has_last: Number(typeof item.version_last === "string"),
versionLast: item.version_last,
version_last: item.version_last,
flag_type: type,
flag_name: name,
has_value: Number(typeof value_to_set === "string"),
Expand Down
34 changes: 12 additions & 22 deletions l10n/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,23 @@ compat-branch-prefix-altname = Prefix: <code data-l10n-name="prefix">{ $prefix }
compat-support-removed = Removed in { $version } and later
compat-support-see-impl-url = See <a data-l10n-name="impl_url">{ $label }</a>
compat-support-flags =
{ $has_added ->
[1] From version { $version_added }
*[0] {""}
}{ $has_last ->
[1] { $has_added ->
*[0] Until { $versionLast } users
[1] {" "}until { $versionLast } users
}
*[0] { $has_added ->
*[0] Users
[1] {" "}users
}
}
{" "}must explicitly set the <code data-l10n-name="name">{ $flag_name }</code>{" "}
{ $flag_type ->
{ $version_range ->
[range] From version { $version_added } until { $version_last }, users
[from] From version { $version_added }, users
[until] Until { $version_last }, users
*[none] Users
} must explicitly set the <code data-l10n-name="name">{ $flag_name }</code> { $flag_type ->
*[preference] preference
[runtime_flag] runtime flag
}{ $has_value ->
[1] {" "}to <code data-l10n-name="value">{ $flag_value }</code>
*[0] {""}
}{"."}
{ $has_pref_url ->
[1]{ " " }to <code data-l10n-name="value">{ $flag_value }</code>
*[0] { "" }
}.{ $has_pref_url ->
[1] { $flag_type ->
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
*[other] {""}
[preference]{ " " }To change preferences in { $browser_name }, visit { $browser_pref_url }.
*[other] { "" }
}
*[0] {""}
*[0] { "" }
}

compat-legend = Legend
Expand Down
28 changes: 8 additions & 20 deletions l10n/template.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,21 @@ compat-branch-prefix-altname = Prefix: <code data-l10n-name="prefix">{ $prefix }
compat-support-removed = Removed in { $version } and later
compat-support-see-impl-url = See <a data-l10n-name="impl_url">{ $label }</a>
compat-support-flags =
{ $has_added ->
[1] From version { $version_added }
*[0] { "" }
}{ $has_last ->
[1]
{ $has_added ->
*[0] Until { $versionLast } users
[1] { " " }until { $versionLast } users
}
*[0]
{ $has_added ->
*[0] Users
[1] { " " }users
}
}
{ " " }must explicitly set the <code data-l10n-name="name">{ $flag_name }</code>{ " " }
{ $flag_type ->
{ $version_range ->
[range] From version { $version_added } until { $version_last }, users
[from] From version { $version_added }, users
[until] Until { $version_last }, users
*[none] Users
} must explicitly set the <code data-l10n-name="name">{ $flag_name }</code> { $flag_type ->
*[preference] preference
[runtime_flag] runtime flag
}{ $has_value ->
[1] { " " }to <code data-l10n-name="value">{ $flag_value }</code>
*[0] { "" }
}{ "." }
{ $has_pref_url ->
}.{ $has_pref_url ->
[1]
{ $flag_type ->
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
[preference] { " " }To change preferences in { $browser_name }, visit { $browser_pref_url }.
*[other] { "" }
}
*[0] { "" }
Expand Down
Loading