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

sveltekit-i18n not working with key #1183

Open
gemue-parndt opened this issue Jul 17, 2024 · 0 comments
Open

sveltekit-i18n not working with key #1183

gemue-parndt opened this issue Jul 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gemue-parndt
Copy link

gemue-parndt commented Jul 17, 2024

Describe the bug
I wanna use the following structure:

lib/
├── i18n/
│..........├── en/
│........................├── editor.json

I am using sveltekit-i18n package. In the config file you can configure keys for different spaces. like the following:

const config: Config = {
	loaders: [
		{
			locale: 'de',
			routes: [/\/editor(\/|\d*)?/],
			key: 'editor',
			loader: async () => (await import('./de/editor.json')).default
		},
		{
			locale: 'en',
			routes: [/\/editor(\/|\d*)?/],
			key: 'editor',
			loader: async () => (await import('./en/editor.json')).default
		}
	]
};

My translations file therefore looks like the follwoing:

{
    "save":"Save"
}

I am using the key property from the sveltekit-i18n library so i dont add the editor. prefix in my translation JSON file.
But in this case i18n-ally isn't able to find the correct translation.

Extension Version
i18n Ally v2.12.0

Framework/i18n package you are using
sveltekit-i18n

To Reproduce
Steps to reproduce the behavior:
Described above.

Device Infomation

  • OS: Windows
  • Version: 11
  • VS Code Version: 1.91.1

Extension Log
Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information

🧰 Config "i18n-ally.pathMatcher" changed, reloading
🔁 Reloading loader
🧩 Enabled frameworks: Svelte
🧬 Enabled parsers: json, yaml, json5

🚀 Initializing loader `hidden path ;)`
📂 Directory structure: dir
🗃 Path Matcher Regex: /^(?<locale>[\w-_]+)(?:.*\/|^).*\.(?<ext>json|ya?ml|json5)$/

📂 Loading locales under  `hidden path ;)`src\lib\i18n
	📑 Loading (de) de/editor.json [1721221440018.441]
	📑 Loading (en) en/editor.json [1721220514187.9546]

👀 Watching change on `hidden-path ;)`
✅ Loading finished

Screenshots
image

@gemue-parndt gemue-parndt added the bug Something isn't working label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant