arrow icon indicating copy to clipboard operation
arrow copied to clipboard

Add a Locale Implementation Guide

Open anishnya opened this issue 4 years ago • 1 comments

Issue Description

As we've added new features such as dehumanize, it's starting to become clear there are some major discrepancies between locale implementations. I think it would be a good idea to create some kind of adding new locale guide. This would hopefully help avoid some of the issues/ambiguity we've been having (i.e locale implementations using the translation of "week ago" instead of "a week ago" seen in #982).

anishnya avatar May 31 '21 06:05 anishnya

I think a checklist would be good - something like:

  • [ ] add locale variant names in lower case (e.g. names = ["en", "en-us"]) in arrow/locales.py
  • [ ] add preposition meaning "ago" (e.g. past = "{0} ago")
  • [ ] add preposition meaning "in" (e.g. past = "future = "in {0}")
  • [ ] add conjunction meaning "and" (e.g. and_word = "and")
  • [ ] add timeframes dict with "just now", "a second", "{0} seconds" etc. in the corresponding language
  • [ ] add month_names and their abbreviated forms in the corresponding language
  • [ ] add day_names and their abbreviated forms in the corresponding language
  • [ ] add tests in test_locales.py
  • [ ] add locale to DEHUMANIZE_LOCALES if it supports dehumanize and to tested_langs in def locale_list_no_weeks()

cyriaka90 avatar Aug 25 '21 12:08 cyriaka90