@websolutespa/payload-plugin-localization
v1.7.0
Published
Localization plugin for PayloadCms
Downloads
261
Readme
@websolutespa/payload-plugin-localization
Localization plugin for PayloadCms.
Payload Localization Plugin
A plugin for Payload CMS that automatically adds UI components to manage content localizations at the level of a single localizable field without having to change the document display language every time.
Requirements:
- Payload version 2.28.0 or higher is required.
Installation
npm i @websolutespa/payload-plugin-localization
Usage
import { buildConfig } from 'payload/config';
import { localization } from '@websolutespa/payload-plugin-localization';
import '@websolutespa/payload-plugin-localization/dist/index.css';
export default buildConfig({
plugins: [
localization(),
// The rest of your plugins config goes here
],
});
Plugin options
No options available to configure the plugin.
Features
The plugin only affects fields configured via the Payload collections configuration with localized: true
and automatically adds:
- A sticky component at the top of document with the locale selector to easily switch locales (for all collections even if they do not contain localized fields).
- A "Change localization" button to instantly understand which field are localized and access the localization feature.
- A modal that allows you to edit the existing localizations and insert new ones. The localization in the reference language (current document locale) is always visible to facilitate the translation. You can save all changed localizations at once as drafts or publish them directly.
Note: In order to open the localization modal the document must be saved at least once. Before that, the message "Save document to enable localizations" will appear on the modal opening button.