<?php
/**
 * Shared ZERTI admin locale metadata.
 */

if (!defined('ABSPATH')) {
    exit;
}

/**
 * @return array<string, array{label:string, team:string, google:string, plural_forms:string, direction:string, calendar:string, digits:string}>
 */
function zerti_locale_config(): array
{
    return [
        'fa_IR' => [
            'label' => 'Persian',
            'team' => 'Persian',
            'google' => 'fa',
            'plural_forms' => 'nplurals=2; plural=(n==0 || n==1);',
            'direction' => 'rtl',
            'calendar' => 'jalali',
            'digits' => 'auto',
        ],
        'ar' => [
            'label' => 'Arabic',
            'team' => 'Arabic',
            'google' => 'ar',
            'plural_forms' => 'nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5);',
            'direction' => 'rtl',
            'calendar' => 'hijri',
            'digits' => 'auto',
        ],
        'en_US' => [
            'label' => 'English',
            'team' => 'English',
            'google' => 'en',
            'plural_forms' => 'nplurals=2; plural=(n != 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'fr_FR' => [
            'label' => 'French',
            'team' => 'French',
            'google' => 'fr',
            'plural_forms' => 'nplurals=2; plural=(n > 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'es_ES' => [
            'label' => 'Spanish',
            'team' => 'Spanish',
            'google' => 'es',
            'plural_forms' => 'nplurals=2; plural=(n != 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'tr_TR' => [
            'label' => 'Turkish',
            'team' => 'Turkish',
            'google' => 'tr',
            'plural_forms' => 'nplurals=2; plural=(n != 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'nl_NL' => [
            'label' => 'Dutch',
            'team' => 'Dutch',
            'google' => 'nl',
            'plural_forms' => 'nplurals=2; plural=(n != 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'hi_IN' => [
            'label' => 'Hindi',
            'team' => 'Hindi',
            'google' => 'hi',
            'plural_forms' => 'nplurals=2; plural=(n != 1);',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'th' => [
            'label' => 'Thai',
            'team' => 'Thai',
            'google' => 'th',
            'plural_forms' => 'nplurals=1; plural=0;',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
        'zh_CN' => [
            'label' => 'Chinese',
            'team' => 'Chinese (Simplified)',
            'google' => 'zh-CN',
            'plural_forms' => 'nplurals=1; plural=0;',
            'direction' => 'ltr',
            'calendar' => 'gregorian',
            'digits' => 'auto',
        ],
    ];
}

/**
 * Admin UI locales exposed in Settings → Regional Settings.
 *
 * @return array<string, string> locale => English label msgid
 */
function zerti_selectable_admin_locales(): array
{
    return [
        'fa_IR' => 'Persian',
        'ar' => 'Arabic',
        'en_US' => 'English',
        'fr_FR' => 'French',
        'es_ES' => 'Spanish',
        'tr_TR' => 'Turkish',
        'nl_NL' => 'Dutch',
        'hi_IN' => 'Hindi',
        'th' => 'Thai',
        'zh_CN' => 'Chinese',
    ];
}
