@thetribe/strapi-plugin-init-locales
v1.0.3
Published
Strapi plugin to initialize the locales in your strapi project.
Downloads
1
Keywords
Readme
Strapi plugin init-locales
Creates the different locales for the internationalization plugin.
Installation
Add strapi-plugin-init-locales
to your strapi (v4!).
# npm:
npm install strapi-plugin-init-locales
# yarn:
yarn add strapi-plugin-init-locales
Create these environment variables with your initial values.
INIT_LOCALES=en-US,fr-FR
Note: Do not forget to add the configuration to your config/plugins.[js|ts]
file:
export default ({ env }) => ({
..., // other plugins
'init-locales': {
enabled: true,
config: {
locales: env('INIT_LOCALES', 'en,fr'),
}
}
});
Usage
After installing the plugin and creating your environment variables start your strapi (locally: npm run develop
or yarn develop
) and watch out for the info
-log:
Creating locale [name-of-locale].
Locale [name-of-locale] created.
Note: The plugin will only create the locales if they do not already exists in your strapi application!