Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#11637 closed (fixed)

Formats missing for most locales

Reported by: garcia_marc Owned by: jezdez
Component: Internationalization Version: master
Severity: Keywords: i18n-rf
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

In [11377] incomplete formats for every locale has been added to Django. It's pending that translators complete those formats files, to be able to format data correctly for every locale.

Attachments (14)

no_format.diff (1.9 KB) - added by jonklo 6 years ago.
Norwegian (bokmal) formats
pt_BR_format.diff (1.8 KB) - added by Guilherme Gondim <semente@…> 6 years ago.
Brazilian Portuguese formats
formats_ka.patch (2.1 KB) - added by avsd 6 years ago.
Georgian localization of date/time formats
formats-ko-11304.py (2.0 KB) - added by spike 6 years ago.
formats_nl.diff (3.2 KB) - added by Rudolph 6 years ago.
Dutch formats.py patch
locale_de.patch (1.1 KB) - added by Semmel 6 years ago.
German formats
danish.diff (1.1 KB) - added by finngruwier 6 years ago.
Formats for Danish (da).
01-formats_sr_and_sr-latn.diff (4.2 KB) - added by janos 6 years ago.
formats for Serbian and Serbian latin
11637-es-ar-deactivate-tests.diff (34.0 KB) - added by ramiro 6 years ago.
Argentinina formats, plus other test changes
11637-cs.diff (1.4 KB) - added by Honza_Kral 6 years ago.
test.txt (100 bytes) - added by DrMeers 5 years ago.
Test upload; ignore. Debugging Internal Server Error in djangoproject.com.
en_GB.diff (112.8 KB) - added by DrMeers 5 years ago.
British English (and therefore Australian, etc) formats (+ locale init)
sv_format.diff (1.0 KB) - added by algestam 5 years ago.
Swedish formats
pt_format.diff (1.5 KB) - added by olifante 5 years ago.
added missing formats for pt locale

Download all attachments as: .zip

Change History (30)

Changed 6 years ago by jonklo

Norwegian (bokmal) formats

Changed 6 years ago by Guilherme Gondim <semente@…>

Brazilian Portuguese formats

Changed 6 years ago by avsd

Georgian localization of date/time formats

comment:1 Changed 6 years ago by garcia_marc

(In [11403]) [soc2009/i18n] Norwegian bokmal and Brazilian portuguese formats added. See #11637.

comment:2 Changed 6 years ago by spike

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Attached the Korean patch formats-ko-11034.py, based on revision [source:root/django/branches/soc2009/i18n-improvements/django/conf/locale/ko/formats.py]

Changed 6 years ago by spike

comment:3 Changed 6 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by Rudolph

Dutch formats.py patch

Changed 6 years ago by Semmel

German formats

Changed 6 years ago by finngruwier

Formats for Danish (da).

Changed 6 years ago by janos

formats for Serbian and Serbian latin

comment:4 Changed 6 years ago by jezdez

  • Keywords i18n-rf added
  • milestone set to 1.2
  • Owner changed from garcia_marc to jezdez
  • Status changed from new to assigned

comment:5 Changed 6 years ago by jezdez

  • Patch needs improvement set
  • Summary changed from [soc2009/i18n] Formats missing for most locales to Formats missing for most locales

comment:6 Changed 6 years ago by jezdez

I've added all formats up to 01-formats_sr_and_sr-latn.diff to trunk in r11964.

Changed 6 years ago by ramiro

Argentinina formats, plus other test changes

comment:7 Changed 6 years ago by ramiro

Week starts on Sundays on Argentina, that's the only item that differs from the 'es' formats.py but warrants creation of a es_AR/formats.py.

This led to the following sequence:

  • Now that es_AR/formats.py exists, [source:trunk/tests/regressiontests/i18n/tests.py?rev=11964#L287 this test] (test_dates_and_numbers) can't use es-ar anymore to verify the fallback to es. Changed it to es-us (just like we are doing in the tests for the Accept-Language HTTP header tests.)
  • This led to this test failure:
    ======================================================================
    FAIL: test_dates_and_numbers (regressiontests.i18n.tests.TranslationTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/r/django/es_ar_fmts/tests/regressiontests/i18n/tests.py", line 288, in test_dates_and_numbers
        self.assertEqual(u'31 de Diciembre de 2009', date_format(d))
    AssertionError: u'31 de Diciembre de 2009' != u'31 de diciembre de 2009'
    

This is because previously even when the es_AR formats file didn't exist and the formats machinery was falling back to es, the 'F' format specifier still used the es_AR translation (Django es translation of December is diciembre', es_AR translation is 'Diciembre'). I don't know if this can be considered a bug and didn't pursue it further. I corrected the test by just changing the expected string to contain 'diciembre'.

  • The above test failure causes also this other one:
    ======================================================================
    FAIL: test_lazy_objects (regressiontests.i18n.tests.TranslationTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/r/django/es_ar_fmts/tests/regressiontests/i18n/tests.py", line 13, in test_lazy_objects
        self.assertEqual(u'Add Ringo', s % d)
    AssertionError: u'Add Ringo' != u'A\xf1adir Ringo'
    

This is because the assertEqual-generated exception left an activate() call not paired with a deactivate() call and the next test (in this case test_lazy_objects) got an unclean environment. I solved this by putting the assert* calls after an activate() call inside try blocks with deactivate in the finally branch.

I can split the patch in two if needed and put the 'non-es-ar formats' part on another ticket.

Changed 6 years ago by Honza_Kral

comment:8 Changed 6 years ago by jezdez

(In [11975]) Updated Czech format strings. Thanks Honza Král. Refs #11637.

comment:9 Changed 6 years ago by jezdez

(In [11976]) Updated i18n tests a little to handle test failures better and updated Argentinian Spanish format strings. Thanks to Ramiro Morales. Refs #11637.

comment:10 Changed 6 years ago by jezdez

(In [12455]) Fixed #12868 - Updated French format file. Thanks stephaner and claudep.

Refs #11637.

comment:11 Changed 5 years ago by DrMeers

Have just tried uploading en_GB patch, but am getting Internal Server Errors! Will keep trying...

It includes formats for British English (and therefore Australian, etc) and necessary code to initialise the new locale.

Changed 5 years ago by DrMeers

Test upload; ignore. Debugging Internal Server Error in djangoproject.com.

Changed 5 years ago by DrMeers

British English (and therefore Australian, etc) formats (+ locale init)

Changed 5 years ago by algestam

Swedish formats

Changed 5 years ago by olifante

added missing formats for pt locale

comment:12 Changed 5 years ago by jezdez

(In [13051]) Updated Portugese locale formats. Refs #11637.

comment:13 Changed 5 years ago by jezdez

(In [13052]) Updated Swedish locale formats. Refs #11637.

comment:14 Changed 5 years ago by jezdez

(In [13053]) Added British English translation. Refs #11637.

comment:15 Changed 5 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing this now since we are close to the 1.2 rc. Format updates should be dealt with like any other contribution.

comment:16 Changed 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top