Skip to content
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] localization of snippets inside shortcodes #4783

Closed
Tracked by #4467
ymotongpoo opened this issue Jul 3, 2024 · 2 comments · Fixed by #4787
Closed
Tracked by #4467

[i18n] localization of snippets inside shortcodes #4783

ymotongpoo opened this issue Jul 3, 2024 · 2 comments · Fixed by #4787
Assignees
Labels
enhancement New feature or request i18n internationalization

Comments

@ymotongpoo
Copy link
Contributor

ymotongpoo commented Jul 3, 2024

What needs to be changed?

Currently, ja and zh localizations are happening. The localization is usually done in the following steps:

  1. copy the original content under content/en and move them to the corresponding directory of each language. (eg. content/ja)
  2. translate the content

However, some of the documents are embedded in Hugo short codes, which are out of content directory.

For example, This is the screenshot of the Japanese translation of concepts > resources page:

image

As you see, the first two paragraphs are not translated yet. The corresponding markdown of this page is:

## はじめに

{{% docs/languages/resources-intro %}}

オブザーバビリティバックエンドに[Jaeger](https://www.jaegertracing.io/)を使用している場合、リソース属性は**Process**タブの下にグループ化されます。

This short code is located at layouts/shortcodes/docs/languages/resources-intro.md. How can we localize these short codes?

What is the name + path of the page that needs changed?

layouts/shortcodes/docs/languages

Additional context:

@ymotongpoo ymotongpoo added the bug Something isn't working label Jul 3, 2024
@chalin chalin self-assigned this Jul 3, 2024
@chalin chalin added enhancement New feature or request i18n internationalization and removed bug Something isn't working labels Jul 3, 2024
@svrnm
Copy link
Member

svrnm commented Jul 3, 2024

@chalin any ideas how to address this? Should we have "localized" shortcodes or should we use translated strings and put that text into some TOML files?

@chalin
Copy link
Contributor

chalin commented Jul 3, 2024

Both approaches could be useful (or even a combination of both), but my feeling is that the complexity of a shortcode warrants it being localized, something like this, PTAL:

@chalin chalin mentioned this issue Jul 3, 2024
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18n internationalization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants