-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Update glossary_tooltip.html to include relLangURL for $external_link #46306
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/area web-development
@@ -17,7 +17,7 @@ | |||
|
|||
{{- $tooltip := $tooltip | replaceRE "(?s)<a class='glossary-tooltip'.*?>(.*?).*</a>" "$1" | plainify -}} | |||
{{- $tooltip := trim $tooltip " \n" -}} | |||
<a class='glossary-tooltip' title='{{- $tooltip | safeHTML -}}' data-toggle='tooltip' data-placement='top' href='{{ $external_link }}' target='_blank' aria-label='{{ $text }}'> | |||
<a class='glossary-tooltip' title='{{- $tooltip | safeHTML -}}' data-toggle='tooltip' data-placement='top' href='{{ $external_link | relLangURL }}' target='_blank' aria-label='{{ $text }}'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone wants to link to an English page explicitly (because there's no localized version of it yet), does that still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter due to the rules upon which the glossary page is built.
Let's take the Polish language as an example, https://deploy-preview-46306--kubernetes-io-main-staging.netlify.app/pl/docs/reference/glossary/?all=true#term-api-group — there is no file content/pl/docs/reference/glossary/api-group.md
and English version is incorporated instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another example, Chinese version of Dockershim glossary term references Docker Engine.
Docker Engine has full_link: https://docs.docker.com/engine/
and the link works as expected 🎸 with the proposed in this PR amendment.
website/content/zh-cn/docs/reference/glossary/docker.md
Lines 2 to 7 in 54ffdac
title: Docker | |
id: docker | |
date: 2018-04-12 | |
full_link: https://docs.docker.com/engine/ | |
short_description: > | |
Docker 是一种可以提供操作系统级别虚拟化(也称作容器)的软件技术。 |
/area localization |
This fine-tuning will help to avoid explicit manual language prefixing for the
full_link
. This change does not affect already language prefixedfull_link
(e.g. zh-cn)