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

Localise media paths in walkthroughs #241767

Open
PeterWone opened this issue Feb 24, 2025 · 0 comments
Open

Localise media paths in walkthroughs #241767

PeterWone opened this issue Feb 24, 2025 · 0 comments
Assignees

Comments

@PeterWone
Copy link

PeterWone commented Feb 24, 2025

For context see microsoft/vscode-l10n#180

Strings directly defined in walkthroughs can be localised with the usual %walkthroughs.mykey% mechanism.

However, walkthroughs depend heavily on references to resources like images and Markdown documents.

  "walkthroughs.howToPrint.title": "Premiers pas avec l’impression",
  "walkthroughs.howToPrint.description": "Découvrez l’impression dans l’éditeur pour le code source et la documentation.",
  "walkthroughs.steps.printEditorActive.title": "Imprimer l’intégralité du contenu de l’éditeur actif",
  "walkthroughs.steps.printEditorActive.media": "assets/print-entier-content-editeur-actif.fr.md",

As you can see in the above excerpt from a package.nls.fr.json, the path to walkthroughs.steps.printEditorActive.media was inappropriately localised.

After some discussion on the linked issue, our tentative proposal is

  1. Define a token {locale}
  2. Path strings requiring this kind of localisation are marked by the presence of {locale}
  3. Localise them by replacing the token with the locale code for each generated file

This approach makes no assumptions about the structure of the resource path; the locale might name a directory, or it might be part of the filename. It does require that resource filenames for the default language have literal {locale} in the name or path. The below examples are in the context of contributed settings in package.json

  "walkthroughs.steps.printEditorActive.media": "assets/print-entire-content-active-editor.{locale}.md",

or

  "walkthroughs.steps.printEditorActive.media": "assets/{locale}/print-entire-content-active-editor.md",

This should extend to the properties of object values.

"media": {
	"image": "media/image.{locale}.png",
	"altText": "%walkthroughs.foo.media.altText%"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants