smartLink() should fall back to English in some way
See original GitHub issueWe have a lot of xrefs and sidebars (soon!) that use smartLink()
and these can recover to fall back to English if the translated content doesn’t exist.
We can discuss implementation choices here. For example:
<a class="page-not-created" title="Not yet created ...">SomeApiMethod</a> <a href="/en-US/docs/SomeApiMethod">English</a>
<a title="Not available in Japanese. Falling back to English" href="/en-US/docs/SomeApiMethod">SomeApiMethod</a>
<small>In English</small> <a href="/en-US/docs/SomeApiMethod">SomeApiMethod</a>
- (Chris’s suggestion)
<a title="Page only currently available in English" href="/en-US/docs/SomeApiMethod">SomeApiMethod (en-US)</a>
Any other ideas?
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
Fallback language iOS (with incomplete Localizable.strings file)
Is there any way to tell my app, that it should use f.e. english as the fallback if there is no value for...
Read more >How to Use Your Card - PATH SmartLink
What happens if the SmartLink Card is lost, stolen, or malfunctioning? Registered SmartLink cardholders should call PATH immediately at 1-800-234-PATH/7284 and ...
Read more >Fire TV Stick: How to Change Language (or get ... - YouTube
I show you how to change the language or change language to English if you are stuck in another language on the Amazon...
Read more >Roku TV's: How to Change Language & Get Back to English if ...
I show you how to change the language as well as how to get back to English if you are stuck in another...
Read more >Firebase Dynamic Links
Firebase Dynamic Links are links that work the way you want, on multiple platforms, and whether or not your app is already installed....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I feel a bit uneasy about solution 2. A little while back we got rid of the title tooltip stuff from all the *xref macros because of concern over accessibility bad practice. I believe the concern is that not all AT reads out the title contents consistently, , at least not by default, so you are supposed to not include any vital information in there, just extra “nice to have” information that isn’t vital for usage.
I can also see the problem of solution 1. Having an extra link to the English version after each non-existent page link could be really ugly, and detract from the user experience.
I think the knowledge that you are about to go to an English page is essential knowledge for site users, so it should be in the link text.
The knowledge that the page doesn’t exist yet, which is why they are being sent to the English page , isn’t essential knowledge to use the site, but it is useful knowledge, especially if you are a (would be) contributor. I’d therefore suggest that we use a variant of solution 2 along these lines:
So you have the essential information available in the link text (this is the English version you are going to), and the tooltip then gives more of a clue as to what is going on. I’d be happy to also combine this with a slightly different styling, plus a note on the Localization contribution page to explain what is gong on here in more detail.
Thanks for leading this discussion @peterbe! Let’s move ahead with @chrisdavidmills’ solution.