opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
22 stars 0 forks source link

Bug: svelte 5 rune, Requires language switching twice. #125

Closed XIYO closed 1 month ago

XIYO commented 1 month ago

i used translator

https://github.com/opral/inlang-paraglide-js/assets/27078637/092e517c-2789-4eb5-926b-96eed9a32ef5

Symptoms: First, after clicking a different language (en), the on-mount log shows that there are two mounts happening after the language switch:

Second, upon clicking a different language (en) again, it performs the intended functionality (changes language, normal mount).

The URL changes correctly on the first click.

There was one issue that has been closed. However, it seems that it has not been resolved yet. https://github.com/opral/inlang-paraglide-js/issues/43 The author concluded to add a data-svelte-reload property to the anchor tag, but this solution causes layout repaints.

    "devDependencies": {
        "@inlang/paraglide-js": "1.9.1",
        "@inlang/paraglide-sveltekit": "^0.8.1",
        "@sveltejs/adapter-auto": "^3.2.1",
        "@sveltejs/kit": "^2.5.10",
        "@sveltejs/vite-plugin-svelte": "^3.1.0",
        "svelte": "5.0.0-next.141",
        "svelte-check": "^3.7.1",
        "typescript": "^5.4.5",
        "vite": "^5.2.11"
    }

https://github.com/XIYO/paraglidejs-test001

LorisSigrist commented 1 month ago

Thanks for reporting this in such detail!

I reopened https://github.com/opral/inlang-paraglide-js/issues/43. I am however not entirely sure that this is a duplicate of that so I will leave both open.

XIYO commented 1 month ago

5.0.0-next.148 is fixed

https://github.com/opral/inlang-paraglide-js/assets/27078637/852d6b11-015d-44eb-a2fc-7c548f989bcd