@websolutespa/payload-plugin-localization
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

@websolutespa/payload-plugin-localization

npm version

status alpha

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.

Screenshots

PayloadLocalizationPlugin


this library is for internal usage and not production ready

Package Sidebar

Install

npm i @websolutespa/payload-plugin-localization

Weekly Downloads

58

Version

1.7.0

License

MIT

Unpacked Size

54.9 kB

Total Files

6

Last publish

Collaborators

  • m.fort
  • giacomo_grassetti
  • federicodiluca
  • cbrualdi
  • actarian
  • websolute-admin