zankhq / astros

Template with astro, tailwind and alpinejs

Home Page:https://astros.zank.studio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

localized text is not shown on local build

enricogallesio opened this issue · comments

Hello
I successfully deployed a newly cloned Astros on netlify, it works correctly. However, when I build that same repo locally with "npm run build" and then "npm run preview" the all the localized texts are not shown, instead just placeholders like "hero.title" or "hero.main_button_text" are displayed. Same with "npm run dev".

sshot

I'm not sure what I'm doing wrong. I tried using the same node and npm versions as netlify but my local build keeps failing at showing the translated text.

Logs and warning look the same on netlify and in local.

Could you please help me troubleshooting this issue?
Thank you very much

Hi @enricogallesio,

I was not able to reproduce the bug, are you using windows or mac?

Do you see see any particular warning/error on the console?


Anyway I m planning to change the localization system sometime in the next weeks as astro-i18next doesn't seem to be maintained anymore.

I think astro-i18n-aut use a better approach for localization.

If you want you may try to look at how i have implemented astro-i18n-aut on the astro-starter template https://github.com/zankhq/astro-starter.

If you wanna try to switch the steps essentially are:

Hi
I'm on linux, however I've found a similar problem with astro-18next mentioned here happening on other OS.
I haven't figured out this yet, but in the meantime I'll try with astro-i18n-aut which seems more promising.
Thank you very much for your help!

I've found the problem that caused the issue. Oddly enough, the issue was caused by the presence of a white space in the local path of the project. facepalm

White space removed, issue solved.
Thank you again!

hey @enricogallesio what did you change? i too have same issue but in macos

hey @enricogallesio what did you change? i too have same issue but in macos

Not sure if it's the same bug, I've just removed a white space from the local project path of directories.

I'm pretty sure this bug can be caused by a missing space or special characters escaping in the project path, but this may not be the only way to trigger this issue

Not sure if it's the same bug, I've just removed a white space from the local project path of directories.

noob question, which local project path? which config?

Not sure if it's the same bug, I've just removed a white space from the local project path of directories.

noob question, which local project path? which config?

For local path I mean the path of directories (folders) on your local system. For example mine was something like:
eg. /home/myname/personal project/astros
as you can see there is a empty space in the "personal project" folder name. When I simply removed that space in the folder name everything worked again.
eg. /home/myname/personalproject/astros

I'm not sure where is the bug, but in my case this simple workaround fixed the issue. I also should admit that spaces in folders names are not generally recommended. And that's for a reason...

Hope this helps!

This surprisingly worked :)