Conversation
|
@agsoto is attempting to deploy a commit to the cworld Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I tried to replicate the error on my machine changing configuration such as the Astro routing with prefixDefaultLocale: true and disabling redirections but still no similar error appears. Do you get the error on the home? |
|
I've never tried Can you making sure your code can work well with static mode? I mean, build it, and make a server like python http to test it |
|
Seems something not work well? I checked the deployment, something mixed the zh and es language, and seems cannot render content when the language is not the default ones. If you want the authentication of deployment, you can visit https://astro-theme-pure-n7se13krf-cworld.vercel.app/ and send me the request (you know, Vercel is good for personal usage, but has some limitations for collaboration on free account) |
Sure, I'll do it in a new github repo just for dev-test purposes.
Yep, I saw that it seems that the rendering order of nested components wouldn't compute the locale in the intended order, I pushed few more commits on that. Regarding the content not rendering content other than default, I assume you're talking about getting 404 error page when you enter pages other than blog and there's a decision to make that I mentioned before. I can think of three approaches: Option ADuplicate the same pages structure under [lang]. Right now it's set only for the blog page and the home. Option BKeep only pages under [lang]. Option CWe leave only the backbones of internationalization along with helper functions, ready to use components and no [lang] pages by default. In summary: It's deciding how much of the feature would be usable out of the box. Until this point only archive, tags and sitemap is remaining to be ready for review, I'll keep working on those later. Sorry for the long reply I think it's important to discuss it, I will try the vercel request, thanks! |
|
Alright, there might be more options fixing the bug that was happening on Edit: Warning on build is still present :S I'll have to find a solution replacing Astro.currentDefault |
|
Your code is starting to get bigger, which makes me confused about how you implement your features, that affects me to give you some indirect help that might be useful. It is better to read the official documentation carefully (I feel like I would get something new every time I read it), and the official example project starlight |
6411929 to
5a36c93
Compare
|
Hello! You were right to be suspicious, I realized some functions were re-implementations of Astro's i18n helpers. Looking at the docs and code of Starlight helped me a lot, thanks.
Now I can offer a much more polished version:
Is still remaining the work mentioned before regarding tags, archives and sitemap and the decision given the options in the previous comment. But for now it's ready to be reviewed. Let me know your thougths. |
|
Considering Starlight is a more complex and complete system, you might want to simplify things a bit. I'll might be very busy lately, but I'll try to review the code and consider merging as much as possible when I have some time😊 |
|
A small warn when build: |
|
Indeed the Starlight project has a bunch of stuff, including the usage i18next. As you'll see the more complex thing on the PR is the translation strings part, which uses Astro's collections just like Starlight, the rest is mainly for the language switch and routing. |
22dbbac to
c1da27c
Compare
|
plz consider rebase (if it is very hard for rebase, merge is also allowed) main branch with new coming commits. This will help us better accept your pr without a lot of conflicts. tk you again😉 |
|
if you've done that work, you can tell me here. I will take the time to make better small changes |
|
I rebased a few times, last was until version 4.1, it seems those remaining conflicts are happening because a later update. These are busy dates for me but as soon as I rebase again I'll leave a message too |
c1da27c to
469739d
Compare
|
@cworld1 Apparently there weren't many confusing conflicts, I rebased again with builds working fine. After the decision about including i18n ready pages in the template and your code review, maybe just doc updates would be left. |
|
Well, after spent so much time on making a lot of changes that don't matter, I decide to spent a whole version on your pr, and plan to release a pre-release version that can prevent bugs. You can continue to rebase all your work, and then I'll transfer your work in |
469739d to
f0177a8
Compare
|
Hi @cworld1 Happy new year! I've just rebased again. Although changes are few, those are becoming more confusing to rebase and more bug prone. I see there's a few astro.config.ts conflicts but those changes were made after v4.1.2, I think it would be a good idea to merge ASAP and rebase the later changes from your side. |
609ef4f to
f0177a8
Compare
|
If it is hard for you to use rebase, you can directly use git merge instead. And sorry I'll be busy in next a few days, for preparing exam :( |
- add src/pages/[lang]/** routes for localized blog and pages
- add packages/pure/components/basic/LanguageSwitch.astro and LocaleRedirect.astro
- add locale dictionaries packages/pure/i18n/locales/{en,es,zh}/common.ts
- add locale utils packages/pure/utils/locale.ts and locale-client-redirect.ts
- add src/middleware.ts for locale detection and redirects
- update header/footer, layouts, TOC, and post preview to use i18n
- update astro.config.ts , src/site.config.ts , and tsconfig.json for locales
- move zh blog content to src/content/localized/zh/blog/**
- update exports and types in packages/pure/index.ts , components/basic/index.ts , types/* , and plugins/virtual-user-config.ts
…ld path Delete src/content/blog/markdown-zh/* and add localized copies under src/content/localized/zh/blog/markdown-zh
…files to JSON format - Replace TypeScript locale files with JSON format for better maintainability - Remove locale redirect functionality and related components - Simplify i18n implementation using Astro's built-in i18n utilities - Update components to use getRelativeLocaleUrl instead of localizeLink - Consolidate locale-related utility functions - Add support for content-based i18n loading - Improve language switch component with better accessibility
- Replace 'language' field with 'lang' in blog posts for consistency - Add getLanguageDisplayName utility for locale name formatting - Update i18n JSON files with new structure and translations - Implement locale-aware routing for tags and archives - Refactor static path generation for localized pages - Update UI components to use new i18n system
- Add new localized rss feed endpoint at /[lang]/rss.xml - Refactor image path resolution to support both default and localized blog directories - Improve hero image URL handling with external URL support - Normalize blog post URLs for locale support
- Add missing translations for blog and common strings in all supported languages - Add left locale handling to use Astro.currentLocale consistently - Refactor messy static path generation for localized routes - Improve back button navigation with proper locale URLs
f0177a8 to
701e1b2
Compare
|
@cworld1 I'm wondering if the changes are going to be merged next, as they supposed to be on v4.1.3? Otherwise I see no point on rebasing endlessly and we should rather drop and close the PR |
|
Sorry for that. I really like this feature in fact, but you know I haven't been able to find time recently, and some basic maintenance work still needs me to finish. In fact, v4.1.3 only makes basic maintenance and doesn't add any new substantial features. |
|
If you have patience, you can choose to close this PR first. And in the future, when I have time or interest, I will leave a message here inviting you to open a new collaboration. How about this? |
|
Let's keep this open then. I hope when you can dedicate some effort to this you will tag me here again, expecting I'll also provide help if needed for the merge ✌️ |

Hello! This is the draft we talked about on #82. Key considerations I had for the changes:
Caveats:
I understand you're busy right now but I would like to know your thoughts on the approach when you have the time.
Thank you! 😃