Utilities for Flarum Language Packs.

1.0.1 2023-06-13 18:30 UTC

This package is auto-updated.

Last update: 2024-10-13 21:13:11 UTC


README

Latest Stable Version Latest Unstable Version License Total Downloads Monthly Downloads

This package provides useful utilities for Flarum Language Packs.

Installation

You can install this package using Composer:

composer require flarum-lang/utils

Usage

LanguagePackWithVariants

This is an extender dedicated for language packs with multiple variants of translations (for example formal and informal translations). Use it instead of Flarum\Extend\LanguagePack in extend.php:

return [
    new FlarumLang\Utils\Extend\LanguagePackWithVariants([
        'label' => 'Variant',
        'variants' => [
          'informal' => 'Informal',
          'formal' => 'Formal',
        ],
        'defaultVariant' => 'informal',
    ]),
];

Links