flarum-lang / utils
Utilities for Flarum Language Packs.
Installs: 13 408
Dependents: 6
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- flarum/core: ^1.0
This package is auto-updated.
Last update: 2024-11-13 21:22:33 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', ]), ];