question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

smartLink() should fall back to English in some way

See original GitHub issue

We 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:

  1. <a class="page-not-created" title="Not yet created ...">SomeApiMethod</a> <a href="/en-US/docs/SomeApiMethod">English</a>
  2. <a title="Not available in Japanese. Falling back to English" href="/en-US/docs/SomeApiMethod">SomeApiMethod</a>
  3. <small>In English</small> <a href="/en-US/docs/SomeApiMethod">SomeApiMethod</a>
  4. (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:closed
  • Created 3 years ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
chrisdavidmillscommented, Mar 3, 2021

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:

<a title="Page only currently available in English" href="/en-US/docs/SomeApiMethod">
  SomeApiMethod (en-US)
</a>

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.

3reactions
escattonecommented, Mar 3, 2021

Thanks for leading this discussion @peterbe! Let’s move ahead with @chrisdavidmills’ solution.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found