Opened 17 years ago
Closed 17 years ago
#6859 closed (fixed)
Javascript i18n doc errors
Reported by: | Ramiro Morales | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As reported in http://groups.google.com/group/django-users/browse_frm/thread/12f39fe090d39e78?hl=en, patch included
Attachments (2)
Change History (6)
by , 17 years ago
Attachment: | js-i18n-doc.diff added |
---|
follow-up: 2 comment:1 by , 17 years ago
follow-up: 3 comment:2 by , 17 years ago
Replying to julien:
The 'named' argument should be a boolean indicating whether or not you want to use a dictionary instead of a list of name-less arguments.
However, in the doc, the given example is [...] missing a 'true' argument
I'm attaching a new revision of the patch that adds a refactoring of the documentation fot the javascript_catalog
view JavaScrpt i18n funtions to take all these suggestions in account. Thanks!.
Also, will close #6355 as a dupe, it's already accepted but this ticket also fixes other problems in the same area of the documentation and has a patch.
by , 17 years ago
Attachment: | js-i18n-doc.2.diff added |
---|
comment:3 by , 17 years ago
Thanks, great patch! Just a tiny remark. You mention about the *fmt* argument, and then in the example you use "fmts". I know this has no impact on the code at all, but maybe keeping "fmt" all the way through would prevent some confusion.
Replying to ramiro:
Replying to julien:
The 'named' argument should be a boolean indicating whether or not you want to use a dictionary instead of a list of name-less arguments.
However, in the doc, the given example is [...] missing a 'true' argument
I'm attaching a new revision of the patch that adds a refactoring of the documentation fot the
javascript_catalog
view JavaScrpt i18n funtions to take all these suggestions in account. Thanks!.
Also, will close #6355 as a dupe, it's already accepted but this ticket also fixes other problems in the same area of the documentation and has a patch.
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for that. I've spotted another glitch in the doc...
The generated interpolate function is like that:
function interpolate(fmt, obj, named) {
}
The 'named' argument should be a boolean indicating whether or not you want to use a dictionary instead of a list of name-less arguments.
However, in the doc, the given example is:
d = {
};
s = interpolate(ungettext('this is %(count)s object', 'this are %(count)s objects', d.count), d);
It's missing a 'true' argument, and should instead be as follows:
d = {
};
s = interpolate(ungettext('this is %(count)s object', 'this are %(count)s objects', d.count), d, true);
Maybe also adding a mention in the doc like: "In the example above, the argument 'true' indicates that a named interpolation should be considered, instead of a positional one.".
I would have amended your patch but it won't apply entirely (the 'ungettext' are still there after application of the patch). Do you want to amend your patch yourself and post it again?
Cheers!