# i18n Configuration for TypeDialog Example 17
# Defines fallback chains, locale information, and translation rules

[locales]
default = "en-US"
fallback = "en-US"

# Locale definitions with metadata
[locales.en-US]
name = "English (United States)"
direction = "ltr"
plurals = 2
decimal_separator = "."
thousands_separator = ","
date_format = "MM/DD/YYYY"
currency_symbol = "$"
currency_position = "prefix"

[locales.en-GB]
name = "English (United Kingdom)"
direction = "ltr"
plurals = 2
decimal_separator = "."
thousands_separator = ","
date_format = "DD/MM/YYYY"
currency_symbol = "£"
currency_position = "prefix"

[locales.es-ES]
name = "Spanish (Spain)"
direction = "ltr"
plurals = 2
decimal_separator = ","
thousands_separator = "."
date_format = "DD/MM/YYYY"
currency_symbol = "€"
currency_position = "suffix"
gender_aware = true

[locales.es-MX]
name = "Spanish (Mexico)"
direction = "ltr"
plurals = 2
decimal_separator = "."
thousands_separator = ","
date_format = "DD/MM/YYYY"
currency_symbol = "$"
currency_position = "prefix"
gender_aware = true

[locales.pt-BR]
name = "Portuguese (Brazil)"
direction = "ltr"
plurals = 2
decimal_separator = ","
thousands_separator = "."
date_format = "DD/MM/YYYY"
currency_symbol = "R$"
currency_position = "prefix"

[locales.pt-PT]
name = "Portuguese (Portugal)"
direction = "ltr"
plurals = 2
decimal_separator = ","
thousands_separator = "."
date_format = "DD/MM/YYYY"
currency_symbol = "€"
currency_position = "suffix"

[locales.fr-FR]
name = "French (France)"
direction = "ltr"
plurals = 3
special_plural_rules = true
decimal_separator = ","
thousands_separator = "."
date_format = "DD/MM/YYYY"
currency_symbol = "€"
currency_position = "suffix"
gender_aware = true

[locales.ja-JP]
name = "Japanese (Japan)"
direction = "ltr"
plurals = 1
decimal_separator = "."
thousands_separator = ","
date_format = "YYYY年M月D日"
currency_symbol = "¥"
currency_position = "prefix"
decimal_places = 0

[locales.ar-SA]
name = "Arabic (Saudi Arabia)"
direction = "rtl"
plurals = 6
decimal_separator = "."
thousands_separator = ","
date_format = "DD MMMM YYYY"
currency_symbol = "﷼"
currency_position = "prefix"
use_arabic_numerals = true

# Fallback chains for locale resolution
[fallback_chains]
# Portuguese Brazil → Portuguese Portugal → Spanish Spain → English
pt-BR = ["pt-PT", "es-ES", "en-US"]
# Portuguese Portugal → Spanish Spain → English
pt-PT = ["es-ES", "en-US"]
# Spanish Mexico → Spanish Spain → English
es-MX = ["es-ES", "en-US"]
# Spanish Spain → English
es-ES = ["en-US"]
# English UK → English US
en-GB = ["en-US"]
# French → English
fr-FR = ["en-US"]
# Japanese → English
ja-JP = ["en-US"]
# Arabic → English
ar-SA = ["en-US"]

# Feature detection
[features]
pluralization = true
gender_agreement = true
number_formatting = true
date_formatting = true
rtl_support = true
fallback_chains = true
context_variables = true

# Validation rules
[validation]
require_all_keys_in_default = false
require_all_keys_in_fallback = false
warn_missing_keys = true
warn_incomplete_translations = true
validate_plural_forms = true

# Coverage thresholds
[coverage]
critical_locales = ["en-US", "es-ES", "fr-FR", "ja-JP", "ar-SA"]
required_coverage_percent = 90
warning_coverage_percent = 75

[testing]
# Test all pluralization forms
test_plurals = true
test_count_values = [0, 1, 2, 3, 5, 10, 11, 21, 100, 1000]

# Test with various dates and amounts
test_dates = true
test_amounts = true
test_amount_values = [1.99, 10.00, 100.50, 1234.56, 9999.99]

# Test RTL text handling
test_rtl = true
rtl_test_locales = ["ar-SA"]

# Test gender-aware strings
test_gender = true
gender_test_locales = ["es-ES", "es-MX", "pt-BR", "pt-PT", "fr-FR", "ar-SA"]
