Open dmitryuck opened 1 year ago
also this will make pages folder structure clear
for ex, we have a structure like pages/blog/index.astro
when we look at pages folder it confusing is it generated or my created files
when it will put generated files in 'en' or 'fr' folder is more clear
I do not need to touch these files since they are generated by i18next plugin
+1 for this, because generation overrides source files, which is a bummer
It really comes with trouble when showDefaultLocale
is enabled:
{
defaultLocale: 'en',
locales: ['en', 'fr'],
showDefaultLocale: true,
}
localizePath('/about')
gives /en/about
which turns out to be a broken link since /en/about.astro
isn’t generated.
It really comes with trouble when
showDefaultLocale
is enabled:{ defaultLocale: 'en', locales: ['en', 'fr'], showDefaultLocale: true, }
localizePath('/about')
gives/en/about
which turns out to be a broken link since/en/about.astro
isn’t generated.
Agreed.
Is there any solution to this?
I have issue that npx astro-i18next generate
does not create folders at all.
import type { AstroI18nextConfig } from "astro-i18next";
const config: AstroI18nextConfig = {
defaultLocale: "fi",
locales: ["fi", "en"],
showDefaultLocale: false,
i18nextServer: {
returnObjects: true,
},
namespaces: [
"lunchlist"
]
};
export default config;
Describe the bug
npx astro-i18next generate
command generates folders for all languages but defaultLocaleExpected behavior
I believe better to generate folder for default locale also
defaultLocale: 'en' locales: ['en', 'fr']
in this case, only pages/fr is generated
but when user put url directly in the browser for e.x.
https://site.com/en
we have an 404 error - page not found,
from root index.astro we can remove
changeLanguage("en");
and do not patch user files, instead use dafault locale, when open on/
so from pages/index.astro we can show defaultLocale content when a language is set in url - from generated folder "pages/en" or "pages/fr"Context (please complete the following information):
astro-i18next
betaastro
version: 2