yassinedoghri / astro-i18next

An astro integration of i18next + some utility components to help you translate your astro websites!
https://astro-i18next.yassinedoghri.com
MIT License
473 stars 33 forks source link

Namespace validation #194

Open ipriel opened 3 months ago

ipriel commented 3 months ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when making content changes (Ex. adding or removing translation keys from a namespace) that there is no way to validate that the change was made in all of the locales.

Describe the solution you'd like

What I am thinking is allowing the use of ts files for namespace definition. That way people can define a type or interface if they want, and the IDE will flag any issues.

Describe alternatives you've considered

An alternative would be a config (similar to the one in Astro Collections) that defines the schema, and then validate the schema on build (or through a CLI command).

While the similarity in usage to the existing Astro Collections config might be more familiar for Astro devs, the ts method feels simpler in usage. I'm unsure which would be easier to implement.

Additional context

If relevant, I am happy to try writing an implementation of this.