grommasdietz/kirby-locale 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固