-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Added localization #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this trigger on pages that aren't linked anywhere? if so, I think the "planned" wording shouldn't be used
The page that displays for "planned" pages was already there before. I only added a 404 page for routes that don't correspond to a markdown file in the wiki folder |
- Got the the wiki's pages metadata out of the markdown files into yaml files - There is now one markdown file per language for each page - Changed the way wiki pages are loaded to account for that - Most texts are now call to the translation store - Translation files can be found in /src/lib/translations
Ah oops sorry I shouldn't have pushed that to the same branch, that kinda completely changes the purpose of the pull request |
So anyways, this is a proposal of a base for localization as requested in issue #18 This changes the structure of the wiki folder to:
With the pages' metadata taken out of the markdown files and into yaml files. The markdown files now only include the content of the page so that it can be translated easily by adding a new markdown file for new languages. For the rest of the text of the application, I simply call a translation store provided by sveltekit-i18n |
I added the french translation as a fonctionnal example |
Holy shit this is amazing! Thank you so much! |
Glad you like it ! |
…opefully functions
… instead of opening when hovered
I was under the impression that we want users to be able to use localization without js enabled (eg. embedded in the URL). Is that still a concern? |
The missing text is supposed to be an icon so maybe it isn't loading for some reason |
Also it should be possible to change the locale depending on the route instead of a local storage variable if you'd prefer that |
None of the icons are loading actually. It seems that it is because of an authentification issue when fetching the fontawesome kit, so I don't know if this is just because this is running in a preview server and fontawesome doesn't recognise the url or if this is an actual problem |
Seems to just be an issue with the test pages |
I add to make some tweaks to force sveltekit to generate the wiki pages for all languages. For example, locales now need to be added to the Aside from those two work-around, everything seems to work very nicely :) |
I corrected the issues I found with the previous version such as the page content not reloading correctly when changing locale and it should now work as intended |
instead of just trying to use the first one then defaulting to english
It is now possible to change the locale with javascript disabled! :) However I noticed during testing that the fontawesome css file imported when javascript is disabled seems to be missing some of icons used in the application |
- This is a pure css solution, meaning that the icons are visible even with javascript disabled - This still allows to use font awesome icons so the site should look identical - See <https://unocss.dev/presets/icons> for the documentation
So I found a solution to the icons not working without javascript by using unocss icons preset. This is a pure css solution meaning that no javascript is required after build and it relies on iconify's icon collection which includes font awesome icons so the site looks exactly the same as before. |
- With javascript disabled, wiki pages with no locale set will now be displayed in the default locale (english) - With javascript enabled, wiki pages with no locale set still redirects to the browser default locale - The lang dropdown now allows to change the locale of a route with no locale set
Looks great! Sorry for not getting to this sooner, last two weeks of school were very busy. Ill merge this in one week to make sure that others have a chance to look at it. |
|
I'll check the translations in a few hours if you want it, as I'm a native French speaker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have forgotten some of them.
I'm sorry too, you'll probably hate me with all these review comments.
I hope one review comment does not equals to one notification.
Sorry for all the french mistakes! I'm a native speaker to but I was mostly focused on the technical aspect and wasn't careful enough when translating 😅 |
You made a replacement mistake, you replaced "IDEA" by "identifiantIDEA" in some files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are remaining french mistakes that we messed up, we will probably fix them in other PRs for other wiki page translations. This PR looks good to me currently.
See preview on Cloudflare Pages: https://preview-65.developer-wiki.pages.dev