Localizing the Assets plugin
Puck Assets is in early access. Request access.
The Assets 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 Assets plugin’s keys start with plugin-assets-.
import { Puck } from "@puckeditor/core";
import { createAssetsPlugin } from "@puckeditor/plugin-assets";
const assetsPlugin = createAssetsPlugin();
export function Editor() {
return (
<Puck
plugins={[assetsPlugin]}
dictionary={{
"plugin-assets-panel-upload": "Cargar nuevo", // Upload button
"plugin-assets-field-browse": "Explorar archivos", // Asset field
}}
config={config}
data={data}
/>
);
}See Puck’s localization guide for a full explanation of localizing, including interpolating values and switching languages at runtime.
Asset fields use the English defaults when the Assets plugin isn’t in plugins.
File sizes follow the browser’s locale. Error messages from the server are shown as they are.
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 assetsPlugin = createAssetsPlugin({ label: "Archivos" });