Enhancement: Extend the i18n/language button #672

Closed
opened 2026-10-05 02:59:46 +02:00 by adam · 2 comments
Owner

CleanShot 2024-09-18 at 18 52 18@2x

Current Behavior:
In a multilingual setup, I can auto-create md|mdx files in all other defined languages. After these are created, the button is basically useless.

Desired/Extended Behavior:
In our case it's a pretty common scenario that we are toggling between different locales of one and the same page. I imagine the current i18n-button being extended to handle both cases:

  • If files in other locales are not yet existent, create them.
  • If files in other locales are existent, open/toggle them.

The only small detail (UX consideration) here is: What if there are more than two locales? – I would suggest in this case, a dropdown/menu (QuickPick) opens that lets the user decide which locale to create and/or open.

![CleanShot 2024-09-18 at 18 52 18@2x](https://github.com/user-attachments/assets/9338dd88-63cd-43cf-9248-17eb2cbc0aaa) **Current Behavior:** In a multilingual setup, I can auto-create `md|mdx` files in all other defined languages. After these are created, the button is basically useless. **Desired/Extended Behavior:** In our case it's a pretty common scenario that we are toggling between different locales of one and the same page. I imagine the current i18n-button being extended to handle both cases: * If files in other locales are not yet existent, create them. * If files in other locales are existent, open/toggle them. The only small detail (UX consideration) here is: What if there are more than two locales? – I would suggest in this case, a dropdown/menu (`QuickPick`) opens that lets the user decide which locale to create and/or open. <!-- github-sync-id:2534242260 -->
adam closed this issue 2026-10-05 02:59:46 +02:00
Author
Owner

@estruyf Could you give me some hints where to stark looking into if I want to try to tackle this myself in a PR? :)

@estruyf Could you give me some hints where to stark looking into if I want to try to tackle this myself in a PR? :) <!-- github-comment-id:2394458146 -->
Author
Owner

To start working on this, you will have to look at the following things:

Let me know if you need help on this one.

To start working on this, you will have to look at the following things: - Registration of the `i18n` action in the editor title bar - https://github.com/estruyf/vscode-front-matter/blob/3d8c550f601cac63563fa17da25047a2076d6a84/package.json#L2450-L2454 - The `frontMatter.i18n.create` command: https://github.com/estruyf/vscode-front-matter/blob/3d8c550f601cac63563fa17da25047a2076d6a84/src/commands/i18n.ts#L260 Let me know if you need help on this one. <!-- github-comment-id:2394971648 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#672