Skip to content

Add Galician (gl) locale#1301

Open
r1cksync wants to merge 1 commit into
arrow-py:masterfrom
r1cksync:add-galician-locale
Open

Add Galician (gl) locale#1301
r1cksync wants to merge 1 commit into
arrow-py:masterfrom
r1cksync:add-galician-locale

Conversation

@r1cksync

Copy link
Copy Markdown

Summary

Adds a new Galician (gl, gl-es) locale. Galician is a Romance language with around 2.4 million speakers, co-official with Spanish in the autonomous community of Galicia (Spain). It is closely related to Portuguese and shares structure with the existing Spanish and Portuguese locales.

The new GalicianLocale class implements:

  • names: ["gl", "gl-es"]
  • past / future / and_word: "hai {0}" / "en {0}" / "e"
  • Full timeframes (singular and plural forms for now/second/minute/hour/day/week/month/year)
  • month_names and month_abbreviations
  • day_names and day_abbreviations
  • meridians
  • Ordinal number formatting (_ordinal_number, e.g. ) and ordinal_day_re, matching the Spanish locale convention

Translation sources

All translations follow the standard normative Galician set by the Real Academia Galega (RAG) and the Instituto da Lingua Galega:

  • Months: xaneiro, febreiro, marzo, abril, maio, xuño, xullo, agosto, setembro, outubro, novembro, decembro
  • Weekdays: luns, martes, mércores, xoves, venres, sábado, domingo
  • Relative time follows standard usage ("hai 2 horas" = "2 hours ago", "en 2 horas" = "in 2 hours")

These also match the Galician CLDR data and GNU gettext Galician locale conventions.

Tests

A comprehensive TestGalicianLocale test class was added to tests/test_locales.py covering:

  • Ordinal numbers
  • Every timeframe (now, seconds, minutes, hours, days, weeks, months, years) in both singular and plural, past and future
  • All 12 month names and abbreviations, all 7 day names and abbreviations
  • Meridians, year methods, relative formatting, describe/describe_multi
  • Regional lookup (gl-es) and the public format / humanize API

Locally, arrow/locales.py reaches 100% coverage and the full suite passes (1925 passed), satisfying the 99% coverage gate. black, isort, and flake8 all pass.

Add a GalicianLocale class supporting the 'gl' and 'gl-es' locale codes,
with month names, month abbreviations, day names, day abbreviations,
meridians, relative-time timeframes, and ordinal number formatting.

Includes comprehensive tests covering every timeframe, all month and day
name lookups, meridians, ordinals, relative formatting and the public
format/humanize API.
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (74b7452).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1301   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2329   +14     
  Branches       358       358           
=========================================
+ Hits          2315      2329   +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@r1cksync r1cksync closed this Jun 23, 2026
@r1cksync r1cksync reopened this Jun 23, 2026
@r1cksync

Copy link
Copy Markdown
Author

Heads-up on the one red check: windows-latest (pypy-3.11) fails during dependency installation (pyyaml build deps can't be fetched/built on the Windows + PyPy runner). This is pre-existing and unrelated to this change — the same job is currently failing on master and on the other open PRs. All other 24 jobs, including Linting and the coverage gate, pass, and the new Galician locale lines are at 100% coverage. Happy to rebase if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants