-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[i18n] Support for external link in another language #298
Comments
Maybe we don't need a custom component for this. I just need to be sure if there is any downsides using
What happens is that when an Final result: |
I'm also not sure whether there is any problem created by using an It's a bit of extra work for the translators! So, just making sure that the benefit of seeing the link of the language outweighs needing to write more for the link than just Markdown. :) |
@Yan-Thomas You can even get this with Markdown links to avoid complicating authoring: html:not([lang="en"]) a[href^="/en/"]::after {
content: " en";
} Requires a CSS declaration for each language but we could probably auto-generate it once #365 is merged as that adds Whether the content is upper or lowercase is not so important because we could style that with CSS too: a::after {
text-transform: uppercase;
vertical-align: super;
font-size: 0.75em;
font-weight: bold;
line-height: 1;
} Alternatively, a remark plug-in could add |
Thanks @delucis, clever solution! Also, I had totally forgotten about I did some tests based on your approach using The |
@Yan-Thomas and everyone, do you think we can close the existing PR then, and continue to discuss here what solution we want for this? In Discord, we also had the points: By @delucis - We could just make the TEXT of the link include (en), and then no one has to write any differently! By @kevinzunigacuellar (I think this is the correct Kevin Z!) - Keeping simple might be better, and is this really a problem to solve? |
I agree with closing the PR and continue the discussion here, @sarah11918 Maybe this could be nice in this moment (where most pages aren't translated and updated yet), but as we translate new pages this loses importance IMO. I also agree with being simple and just letting translators add "(EN)" to links. Maybe we can even document this in the i18n guide as a pattern for links in different languages? |
I agree, @Yan-Thomas , and especially with all the sidebar links indicating which entire pages are in English, maybe it's less needed right now than we think? |
Now that we have lots of pages translated, do we have more ideas/feelings about this, @Yan-Thomas ? |
Something that came up recently was a desire to indicate that a link was to an English fallback version, so say you link to I think we can avoid including disclaimers like this for now — so much is happening that a disclaimer seems likely to be out-of-date sooner rather than later. If we still feel like this kind of thing is helpful in a few weeks, I’d suggest exploring some kind of automated labelling of links similar to how we have the left sidebar set up. |
Hi @sarah11918 , glad we are discussing this again! As I was translating the docs to Brazilian Portuguese, I noticed some cases where we are linking to stuff that is English-only from other websites/blogs we do not control. Examples: Built with Astro and Partial Hydration pages. The visual presentation if we added text manually isn't the best IMO, if we had something like This way we can safely add external links to the docs without worrying about users in other languages being confused about the fact that the link text/description is translated but the link content itself isn't. |
Ohhh, I didn’t think about external links (which is literally in this issue’s title…) Great point! Definite +1 on this. Also I think there are a few places where we link to MDN? A lot of those pages probably are available in other languages, e.g. https://developer.mozilla.org/pt-BR/docs/Web/API/Request, so maybe we also want to make sure to include that where possible. So we have two use cases:
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Adding a component to specify what language the link is referring to
like so :
which is transformed in something like so :
see docs for the Request⁽ᴱᴺ⁾ api in french
The text was updated successfully, but these errors were encountered: