承接 grommasdietz/kirby-locale 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

grommasdietz/kirby-locale

最新稳定版本:2.1.3

Composer 安装命令:

composer require grommasdietz/kirby-locale

包简介

Locale utilities for Kirby CMS

README 文档

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

统计信息

  • 总下载量: 50
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-12