readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Project language locales are rather out of date

Open agjohnson opened this issue 1 year ago • 1 comments
trafficstars

Discussed in:

  • https://github.com/readthedocs/ext-theme/issues/358
  • https://github.com/readthedocs/ext-theme/pull/370

Sphinx uses the standard locales zh_CN and zh_TW, where instead we provide only the translation locale option of zh.

We need:

  • [ ] Update project model locales and add new locales
  • [ ] Deprecate old locales?
  • [ ] Migration from locales that have moved. See django fallbacks for some of these: https://github.com/django/django/blob/99dcc59237f384d7ade98acfd1cae8d90e6d60ab/django/conf/locale/init.py#L599-L628

agjohnson avatar Jun 06 '24 20:06 agjohnson

Comparing the list of our project locales with the current list of locales in Django, we have a lot of old and outdated locales.

Here are the locales that we support that are no longer supported in Django (some locales no longer exist even):

> locale_project - locale_django
{'aa',
 'ab',
 'acr',
 'agu',
 'am',
 'as',
 'ay',
 'ba',
 'bh',
 'bi',
 'bo',
 'caa',
 'cab',
 'cac',
 'cak',
 'co',
 'dz',
 'fj',
 'fo',
 'gn',
 'gu',
 'ha',
 'ie',
 'ik',
 'itz',
 'iu',
 'ixl',
 'jac',
 'jv',
 'kek',
 'kjb',
 'kl',
 'knj',
 'ks',
 'ku',
 'la',
 'ln',
 'lo',
 'mam',
 'mg',
 'mi',
 'mop',
 'mt',
 'na',
 'nb-no',
 'oc',
 'om',
 'or',
 'pnb',
 'poc',
 'poh',
 'ps',
 'qu',
 'quc',
 'qum',
 'quv',
 'rm',
 'rn',
 'rw',
 'sa',
 'sd',
 'sg',
 'si',
 'skr',
 'sm',
 'sn',
 'so',
 'ss',
 'st',
 'su',
 'ti',
 'tl',
 'tn',
 'to',
 'ts',
 'ttc',
 'tw',
 'tzj',
 'ug',
 'uk-ua',
 'usp',
 'vo',
 'wo',
 'xh',
 'xin',
 'yi',
 'yo',
 'za',
 'zu'}

And the locales that Django supports that we should support now:

> locale_django - locale_project
{'ar-dz',
 'ast',
 'bs',
 'ckb',
 'dsb',
 'en-au',
 'en-gb',
 'es-ar',
 'es-co',
 'es-ni',
 'es-ve',
 'hsb',
 'ig',
 'io',
 'kab',
 'lb',
 'nb',
 'nn',
 'os',
 'sr-latn',
 'udm',
 'zh-hans',
 'zh-hant',
 'zh-hk',
 'zh-mo',
 'zh-my',
 'zh-sg'}

I pointed out above that Django has a concept of locale fallback that we aren't using either.

agjohnson avatar Oct 17 '24 16:10 agjohnson

The fallback here to defaulting to the language code is now live, and the pages at least aren't 500ing anymore.

ericholscher avatar Oct 24 '24 20:10 ericholscher

Noting this is the fallback code that Eric refers to in the previous comment: https://github.com/readthedocs/ext-theme/pull/509

humitos avatar Oct 28 '24 09:10 humitos