HiDeoo / starlight-i18n

Visual Studio Code extension - Easily translate Starlight documentation pages.
https://marketplace.visualstudio.com/items?itemName=hideoo.starlight-i18n
MIT License
14 stars 0 forks source link

Translation Not Appearing in Side-by-Side View #10

Closed KMJENK17 closed 2 months ago

KMJENK17 commented 2 months ago

Describe the bug

When attempting to translate a page, I can see all necessary options, but upon translation, I only receive an empty markdown file containing the formatted section.

To Reproduce

  1. Run the extension as usual.
  2. Click on the language option.
  3. Click on the file you want to translate.

Expected behavior

The translated content should highlight the text to be translated or provide a translated version of the markdown file.

How often does this bug happen?

Every time

System Info

Starlight i18n: v0.2.0

Additional Context

The extension may be incorrectly configured, as it doesn't work as expected on two separate repositories. I need help to figure out if this is a setup issue, a bug, or if I am misinterpreting the use of this extension.

Here is a recording of what is occurring:

https://github.com/user-attachments/assets/f4076afb-6307-4737-a97d-770272dcbf5e

This repo is a clean install of an Astro Starlight site. I set up the Internationalization enough to achieve page options to be known.

HiDeoo commented 2 months ago

Thanks for the very detailed report.

If I am not missing anything, I think in this case this is a misunderstanding on how the extension work. When using it, the picker can show up to 2 categories of files: Outdated and Missing (note that if a category is empty, it won't show up).

SCR-20240725-khpv

The Outdated category, if visible, will show files that exists in both the default language and the one you choose in the extension where the default language one contains updates that are not present in the other language. In this case, you get side-by-side editors with the missing changes including additions and deletions on the left and the translated page to update on the right.

SCR-20240725-kmwh

The Missing category, if visible, will show files that exists in the default language but do not exist in the other language. In this case, you get a side-by-side editor with the default language file as the source on the left and a newly created file which only includes a copy of the front matter on the right. As everything should be translated in this case, there is not point to show a diff as everything would be highlighted in the same color and also, this is not possible with the VSCode API.

SCR-20240725-kovq

In the video example you shared, you're opening a missing file so you get a newly created file on the right that you can start translating right away based on the content of the file on the left.

Let me know if that clarifies things or if you have any other questions or it's actually a different issue.

KMJENK17 commented 2 months ago

Definitely misunderstood the purpose of the plugin. Thank you for clarifying the purpose of the plugin. I appreciate your time and explanation.