Code

Opened 6 years ago

Closed 4 years ago

Last modified 3 years ago

#6505 closed (fixed)

make messages should copy the plural rules from the django po files

Reported by: Patrick Lauber <patrick.lauber@…> Owned by: ramiro
Component: Internationalization Version: master
Severity: Keywords: plural rule
Cc: patrick.lauber@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I think it would make the hole process for newbies much more easier if the plural rule from the django .po file from the same language would be copied over. I just found out about this rule after using django for more than a year. We always thought that the po files where corrupt or something but it actually was the missing plural rule that got a django and gettext exception after they where compiled to .mo files. Only if you didn't translate the plural messages it worked. The exception that gets thrown is not helpfull either but is a gettext problem.

.po-file editors like po-edit, gted, django-rosetta all can't handle files with missing plural rules and plural-messages. They crash or produce corrupt .mo files. And looks like it is a problem of the editor and not that of the .po file

If the auto copy of the plural rule from the django core .po file is to much work, please be sure to mention the problem in the documentation.

Attachments (1)

6505-1.diff (2.6 KB) - added by ramiro 4 years ago.
Patch that implements copying the pluiral forms .po file header from the Django one for the same locale if it exists to newly created .po files

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by zgoda

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

Pluralization rules should not be copied from en_US. Each translation team should decide on pluralization rule for its own language. Current rule seems to be fair and consistent with other projects cases.

comment:2 Changed 6 years ago by Patrick Lauber <patrick.lauber@…>

Pluralization rules should be be copied from the corresponding language file. If you have a german translation it should copy the pluralization rules from the german django po file. Pluralization rules are consistent for a language so they can easily be copied.

comment:3 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 4 years ago by mawimawi

I just ran into this problem the other day for a project which has to be translated to slovak. What can I do to help resolve this ticket?

Changed 4 years ago by ramiro

Patch that implements copying the pluiral forms .po file header from the Django one for the same locale if it exists to newly created .po files

comment:5 Changed 4 years ago by ramiro

  • Has patch set
  • Owner changed from nobody to ramiro

comment:6 Changed 4 years ago by ramiro

  • milestone set to 1.2

comment:7 Changed 4 years ago by jezdez

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

(In [12445]) Fixed #6505 - Copy plural forms from Django translation files for newly created translation files. Thanks to Ramiro Morales for the initial patch.

comment:8 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.