grommasdietz/kirby-locale

Locale utilities for Kirby CMS

Maintainers

Package info

github.com/grommasdietz/kirby-locale

Type:kirby-plugin

pkg:composer/grommasdietz/kirby-locale

Statistics

Installs: 49

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 1

2.1.0 2026-03-24 09:36 UTC

README

Locale utilities for Kirby CMS adds a Writer mark and an optional dialog select field so editors can tag language-specific fragments and store per-page title locales.

Cover image showing an example of the plugin in use

Requirements

  • Kirby 5+
  • PHP 8.2+

Installation

composer require grommasdietz/kirby-locale

Tip

If you don’t use Composer, you can download this repository and copy it to site/plugins/kirby-locale.

Quickstart

Writer mark

Enable the locale mark on any Writer field by adding it to the field’s marks list:

fields:
  text:
    type: writer
    marks:
      - locale

The Writer displays the locale mark in the toolbar and highlights tagged segments. Selections get wrapped in <span lang="…">.

Title locales

Activate the title locale selector via grommasdietz.locale.intendedTemplate in site/config/config.php. For a single template:

return [
    'grommasdietz.locale.intendedTemplate' => 'project',
];

For multiple templates:

return [
    'grommasdietz.locale.intendedTemplate' => [
        'project',
        'note',
    ],
];

After configuration, Kirby's create and rename dialogs show the locale dropdown and save the choice as title_locale. Retrieve it in templates with $page->title_locale().

Options

Configure via site/config/config.php:

return [
    // Custom locales
    'grommasdietz.locale.locales' => [
        ['code' => 'en-GB', 'name' => 'English, United Kingdom'],
        ['code' => 'en-US', 'name' => 'English, United States'],
    ],

    // Optional: disable the ISO fallback catalog
    // 'grommasdietz.locale.catalog' => false,
];

Documentation

Full reference for usage, contributions and maintenance lives in documentation.

Changelog

See CHANGELOG.md for version history and changes.

Security

See SECURITY.md for security policies and reporting vulnerabilities.

Contributing

See CONTRIBUTING.md for guidance and expectations.

License

MIT © 2025 Grommas Dietz