Skip to content

flarum-lang/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utilities for Flarum Language Packs

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