#10717 closed enhancement (fixed)
js: make it unnecessary to call babel.format explicitly
| Reported by: | Christian Boos | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | i18n | Version: | 0.13dev |
| Severity: | normal | Keywords: | babel javascript |
| Cc: | Branch: | ||
| Release Notes: |
(JavaScript API improvement) |
||
| API Changes: |
babel.js: it's no longer necessary to call |
||
| Internal Changes: | |||
Description (last modified by )
On the topic of babel.format, any reason why it couldn't be integrated in gettext?
For example, writing:
title: _("Select ticket %(id)s for modification", {id: tId}),
instead of the cumbersome:
title: babel.format(_("Select ticket %(id)s for modification"), {id: tId}),
The change is fully backward compatible.
Now that Jun started to "customize" our babel.js in r11047… Ok, at some point someone should backport this to Babel:source:trunk/contrib/babel.js ;-)
Related branches
Attachments (0)
Change History (4)
comment:1 by , 13 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
| API Changes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Thanks for the feedback! I integrated your fix and rebased the result, plus additional whitespace fixes in repos:cboos.git:ticket10717/babeljs-format-in-gettext.2.
Then committed this as r11068.
comment:4 by , 13 years ago
| Release Notes: | modified (diff) |
|---|



Nice idea! I just tested and it works fine.
However,
ngettext()doesn't format when the string ofsingularis not in the catalog, 7055b55/jomae.git.