Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-variables] Example 5 choice of language #7131

Closed
aphillips opened this issue Mar 10, 2022 · 4 comments
Closed

[css-variables] Example 5 choice of language #7131

aphillips opened this issue Mar 10, 2022 · 4 comments
Labels
Closed Accepted as Editorial css-variables-1 Current Work editorial i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on.

Comments

@aphillips
Copy link
Contributor

(See Example 5)
https://www.w3.org/TR/css-variables-1/#defining-variables

A real-world example of custom property usage is easily separating out strings from where they’re used, to aid in maintenance of internationalization:

:root,
:root:lang(en) {--external-link: "external link";}
:root:lang(de) {--external-link: "externer Link";}

a[href^="http"]::after {content: " (" var(--external-link) ")"}

The variable declarations can even be kept in a separate file, to make maintaining the translations simpler.

The choice of German here isn't perhaps immediately illustrative. Choosing a language (such as French or Japanese) whose translation is more visually distinct might help understanding. Several reviewers noted that they thought the German looked like a typo.

@svgeesus
Copy link
Contributor

Does someone have a good Japanese translation of "external link" in Japanese? @frivoal perhaps

@svgeesus
Copy link
Contributor

I admit that I first read this as "link" vs. "Link" myself.

@svgeesus
Copy link
Contributor

Example is now

		:root,
		:root:lang(en) {--external-link: "external link";}
		:root:lang(el) {--external-link: "εξωτερικός σύνδεσμος";}

		a[href^="http"]::after {content: " (" var(--external-link) ")"}

@svgeesus

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial css-variables-1 Current Work editorial i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on.
Projects
None yet
Development

No branches or pull requests

2 participants