nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.76k stars 484 forks source link

feat: configurable generated file and directory paths #3235

Closed BobbieGoede closed 1 week ago

BobbieGoede commented 1 week ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

Related to #3022 but does not resolve it.

Resolves #3234 Resolves #3188

This only changes the paths in the generated options to be relative, this is still not desirable but better than exposing absolute paths as it could expose sensitive information.

Since this also influences the paths found in the locales array returned by useI18n I have made this a configurable option with experimental.generatedLocaleFilePathFormat to prevent this being a breaking change, in the future I want to look into removing the paths entirely or hashing the file paths.

I'm not sure if there are use cases for end users to have access to the files property on the generated locale options.

πŸ“ Checklist

BobbieGoede commented 1 week ago

Setting back to draft status - the normalizedLocales in the generated options files need their paths processed as well.

BobbieGoede commented 1 week ago

Converting to draft again, the i18nModules langDir paths should be processed as well.