AmberDB

 view release on metacpan or  search on metacpan

lib/AmberDB/Locale/Lang/tr.pm  view on Meta::CPAN

package AmberDB::Locale::Lang::tr;

use 5.016;
use warnings;
use utf8;

our $VERSION = '5.25.1';

my $CREATED  = '2026-07-22';

# -------------------------------------------------------
# Turkish locale data for AmberDB::Locale.
# Pure data module — no logic.
#
# Turkish-specific casing rules (dotted/dotless-I):
#   Lowercase:  I  → ı (U+0131)   dotless i
#               İ  → i            dotted I to i
#   Uppercase:  i  → İ (U+0130)   dotted I
#               (ı → I handled by Perl's uc() already)
# -------------------------------------------------------
sub data {
    return {

        # ---------------------------------------------------------
        # Casing special-cases (see Language.pm for usage)
        # uc_map: replacements applied BEFORE Perl's uc()
        # lc_map: replacements applied BEFORE Perl's lc()
        # ---------------------------------------------------------
        uc_map => {
            'i' => "\x{130}",    # Latin i → Turkish dotted İ (before uc)
        },
        lc_map => {
            'I'        => "\x{131}",  # Latin I → Turkish dotless ı
            "\x{130}"  => 'i',        # Turkish dotted İ → i
        },

        # ---------------------------------------------------------
        # Case-insensitive search regex character map
        # ---------------------------------------------------------
        regex_map => {
            'ç'       => '[çÇ]',
            'Ç'       => '[çÇ]',
            'ÄŸ'       => '[ÄŸÄž]',
            'Äž'       => '[ÄŸÄž]',
            'ı'       => '[ıI]',
            'I'       => '[ıI]',
            'i'       => '[iİ]',
            "\x{130}" => '[iİ]',
            'ö'       => '[öÖ]',
            'Ö'       => '[öÖ]',
            'ü'       => '[üÜ]',
            'Ü'       => '[üÜ]',
            'ÅŸ'       => '[ÅŸÅž]',
            'Åž'       => '[ÅŸÅž]',
        },

        # Phonetic assimilation and final-devoicing rules
        phonetic_map => [
            [ 'b$'    => 'p'  ],
            [ 'd$'    => 't'  ],
            [ 'g$'    => 'k'  ],
        ],

        # ---------------------------------------------------------
        # Optional custom sort collation overrides.

lib/AmberDB/Locale/Lang/tr.pm  view on Meta::CPAN

            hundred_one_prefix  => 0,
            thousand_one_prefix => 0,
        },

        # ---------------------------------------------------------
        # Locale-specific HTML entity extras
        # ---------------------------------------------------------
        html_entities => {
            'ç' => "\x{E7}",   'Ç' => "\x{C7}",   # ç, Ç
            'ş'  => "\x{15F}", 'Ş' => "\x{15E}",  # ÅŸ, Åž
            'ğ'  => "\x{11F}", 'Ğ' => "\x{11E}",  # ÄŸ, Äž
            'â'   => "\x{E2}",  'Â'  => "\x{C2}",   # â, Â
            'î'   => "\x{EE}",  'Î'  => "\x{CE}",   # î, ÃŽ
            'û'   => "\x{FB}",  'Û'  => "\x{DB}",   # û, Û
            'ü'    => "\x{FC}",  'Ü'   => "\x{DC}",   # ü, Ü
            'ö'    => "\x{F6}",  'Ö'   => "\x{D6}",   # ö, Ö
        },

        # ---------------------------------------------------------
        # Month and Day names (Turkish)
        # ---------------------------------------------------------
        months => [
            "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran",
            "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
        ],
        days => [
            "Pazar", "Pazartesi", "Salı", "Çarşamba",
            "PerÅŸembe", "Cuma", "Cumartesi"
        ],

        # ---------------------------------------------------------
        # Formatting metadata (number, currency, date, plural)
        # ---------------------------------------------------------
        number_format => {
            decimal_sep => ',',
            group_sep   => '.',
            group_size  => 3,
        },

        default_currency  => 'TRY',
        currency_position => 'prefix',
        currency_space    => 0,

        date_format => {
            short    => 'DD.MM.YYYY',
            medium   => 'D MMM YYYY',
            long     => 'D MMMM YYYY',
            full     => 'dddd, D MMMM YYYY',
            time     => 'HH:mm',
            datetime => 'DD.MM.YYYY HH:mm',
        },

        plural_rule => 'one{n==1}other',
    };
}

1;

__END__

=encoding utf8

=head1 NAME

AmberDB::Locale::Lang::tr - Turkish Language Definition and Locale Data for AmberDB

=head1 SYNOPSIS

    use AmberDB::Locale;
    my $loc = AmberDB::Locale->new('tr');

=head1 DESCRIPTION

Provides Turkish (tr) casing (including dotted/dotless I rules: C<i -E<gt> İ>, C<ı -E<gt> I>), character maps, number/currency formats, date templates, phonetic devoicing (C<b/d/g -E<gt> p/t/k>), and plural rules for the AmberDB locale engine.

=head1 AUTHOR

Maruf Cetin <marufcetin@gmail.com>

=head1 LICENSE AND COPYRIGHT

Copyright (C) 2005-2026 Maruf Cetin.

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

=cut



( run in 0.848 second using v1.01-cache-2.11-cpan-364913b4093 )