flarum-lang / utils
Utilities for Flarum Language Packs.
2.0.0
2026-03-08 19:07 UTC
Requires
- php: ^7.3 || ^8.0
- flarum/core: ^2.0
This package is auto-updated.
Last update: 2026-03-08 19:09:49 UTC
README
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', ]), ];