GNU gettext - Bugs: bug #60027, Supporting template interpolation...
You are not allowed to post comments on this tracker with your current authentication level.
bug #60027: Supporting template interpolation and tags in JavaScript
Submitter: | Evan Welsh <ewlsh> | ||
Submitted: | Tue 09 Feb 2021 06:33:53 AM UTC | ||
Category: | JavaScript | Severity: | 3 - Normal |
Item Group: | None | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open |
Tue 09 Feb 2021 06:14:15 PM UTC, comment #1: |
Philip Chimento <ptomato> |
Tue 09 Feb 2021 06:33:53 AM UTC, original submission:
GJS hopes to deprecate its formatting module in favor of template strings. Such a change would require xgettext changes to continue supporting translated strings. We're hoping to discuss whether xgettext would ship support for a potential API if we were to implement it in GJS or alternatively what API xgettext would be interested in shipping.
|
Evan Welsh <ewlsh> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2021-02-28 | ewlsh | Attached File | - | Added 0001-Support-template-strings-with-substitutions.patch, #50941 | |
2021-02-09 | ewlsh | Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-02a9.
Corresponding source code
I'd like to express my support for this — backtick strings with interpolation have been around for long enough in JavaScript that there are now plenty of JS programmers who have never experienced the language without them, and so it's natural for them to want to use these strings with gettext.
I like this proposal because it neatly avoids the problems of code inside backtick strings like `My number is ${Math.random()}`, which would just show up as "My number is ${0}" in the messages file.
Many projects using GJS are written in mixed C and JavaScript so xgettext is the natural (and possibly only) tool that will translate strings from a codebase in both of these languages. In GJS we would be eager to implement support for this proposed template tag, but there is no point for us to add it unless xgettext will support it.