Skip to content

Customize External Links According to the Translated Language #4161

@dsr20030703

Description

@dsr20030703

A lot of external links also have multiple languages. For example, the course material has a lot of links to MDN Web Docs, which supports English, Chinese, Spanish, French and Portuguese, all of which this course material have its translation. However, the links are all to the English edition, even though the user is reading the translated content. Although some websites can "Remeber language", e.g. MDN itself, the feature is still experimental and needs to be toggled on manually, and not available in most websites.

So, I suggest external links be customized according to the translated language, follwing these principles:

  1. For websites that can find users' preferred language when language isn't specified (probably by getting the language settings of the browser or the computer), do not specify language, i.e. omit the language specifiers in URLs. For example, suppose your browser is in Simplified Chinese, when giving URLs like https://developer.mozilla.org/docs/Web and https://learn.microsoft.com, you'll be redirected to https://developer.mozilla.org/zh-CN/docs/Web and https://learn.microsoft.com/zh-cn/, but giving URLs with language specifiers to other people won't redirect them to their preferred language, unless they've let the website "Remeber language".
  2. For websites that can't find users' preferred language, like this website, specify the language as the translated language if there is, and English if there isn't. For example, suppose a website supports only Finnish (https://fullstackopen.com/), English (https://fullstackopen.com/en/) and Chinese (https://fullstackopen.com/zh/), then links to this website would be https://fullstackopen.com/ in Finnish edition, https://fullstackopen.com/zh/ in Chinese edition, https://fullstackopen.com/en/ in all other language (including English itself) editions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    generalIssue or pull request that is not specific to any particular part of the course material

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions