Localizing the Pages plugin
Puck Pages is experimental and may change in a future release.
The Pages plugin’s UI uses US English. You can localize it via Puck’s dictionary prop, extended with additional tokens.
Translating plugin strings
To translate strings, provide a dictionary object with the keys you want to change and their corresponding localizations. The Pages plugin’s keys start with plugin-pages-.
import { Puck } from "@puckeditor/core";
import { createPagesPlugin } from "@puckeditor/plugin-pages";
const pagesPlugin = createPagesPlugin();
export function Editor() {
return (
<Puck
plugins={[pagesPlugin]}
dictionary={{
"loader-loading": "cargando", // Puck's loading spinners
"plugin-pages-header-publish": "Publicar", // Publish button
"plugin-pages-panel-new": "Nueva página", // New page button
}}
config={config}
data={data}
/>
);
}Version dates and times follow the browser’s locale.
See Puck’s localization guide for a full explanation of localizing, including interpolating values and switching languages at runtime.
Translating the plugin label
The plugin’s label in the plugin rail is set with the label param. Translate it before passing the plugin to Puck.
const pagesPlugin = createPagesPlugin({ label: "Páginas" });