GNU gettext - Bugs: bug #50920, support Javascript template...
You are not allowed to post comments on this tracker with your current authentication level.
bug #50920: support Javascript template strings in xgettext
Submitter: | Philip Chimento <ptomato> | ||
Submitted: | Tue 02 May 2017 11:14:55 PM UTC | ||
Votes: | 405 | ||
Category: | JavaScript | Severity: | 4 - Important |
Item Group: | None | Status: | Fix Released |
Privacy: | Public | Assigned to: | haible |
Open/Closed: | Closed |
( Jump to the original submission )
Tue 19 May 2020 10:53:29 PM UTC, comment #22: |
Bruno Haible <haible>![]() ![]() |
Tue 19 May 2020 09:40:05 PM UTC, comment #21: The 0.20.2 release fixes the repro in comment #17 but the parsing short-circuit still happens when the template literal lives inside a tag:
|
whiteinge |
Tue 14 Apr 2020 12:25:03 PM UTC, comment #20: The fix is contained in gettext 0.20.2. |
Bruno Haible <haible>![]() ![]() |
Wed 25 Sep 2019 12:41:44 AM UTC, comment #19: In fact, the fix of bug #56678 (already in git) fixes this test case. |
Bruno Haible <haible>![]() ![]() |
Wed 25 Sep 2019 12:31:04 AM UTC, comment #18: Thanks for the report and test case. I can reproduce the issue. |
Bruno Haible <haible>![]() ![]() |
Tue 24 Sep 2019 12:30:08 AM UTC, comment #17: Sorry for all the noise Bruno, here is the minimal reproducer with 0.20.1:
|
Andy Holmes <andyholmes> |
Tue 24 Sep 2019 12:00:00 AM UTC, comment #16: Sorry, my previous remark was a bit hasty. There is definitely something that's breaking xgettext, but its clear to me it's not all template literals.
|
Andy Holmes <andyholmes> |
Mon 23 Sep 2019 06:58:37 PM UTC, comment #15: Hi, sorry to report bad news, but since at least 0.20.1 parsing template literals is entirely broken for me in GJS/JavaScript.
|
Andy Holmes <andyholmes> |
Thu 09 May 2019 07:28:46 PM UTC, comment #14: The fix is contained in the gettext-0.20 release. |
Bruno Haible <haible>![]() ![]() |
Mon 08 Apr 2019 12:29:02 AM UTC, comment #13: Marco,
|
Bruno Haible <haible>![]() ![]() |
Mon 08 Apr 2019 12:11:53 AM UTC, comment #12: Proper parsing of the template literals is implemented through
|
Bruno Haible <haible>![]() ![]() |
Sun 07 Apr 2019 10:09:24 PM UTC, comment #11:
|
Bruno Haible <haible>![]() ![]() |
Thu 25 Oct 2018 05:03:03 AM UTC, comment #10: Thank you for the patches, Marco. The general approach (discarding template strings with any substitutions) sounds reasonable.
|
Daiki Ueno <ueno>![]() |
Fri 07 Sep 2018 02:21:49 AM UTC, comment #9: While I agree that supporting template strings with placeholder is wrong, I think is actually safe to support template strings when they only contain normal text.
|
Marco Trevisan <trevinho> |
Wed 25 Jul 2018 03:22:39 AM UTC, comment #8: Likewise. |
David Mosberger-Tang <dmosberger> |
Wed 18 Jul 2018 12:34:56 PM UTC, comment #7: Same issue here and it's a real PITA. |
Bruno Desthuilliers <brunoblookup> |
Wed 04 Oct 2017 03:05:10 PM UTC, comment #6: Hello,
|
Nicolas Terray <nterray> |
Fri 12 May 2017 12:09:25 PM UTC, comment #5: This is a little bit more serious than simply not extracting such strings - it sometimes breaks parsing of the JS file even if a template string is not used in connection with gettext. As an example, feeding xgettext this file:
|
Vaclav Slavik <vslavik> |
Wed 03 May 2017 08:38:23 PM UTC, comment #4: Ah, I see now, thanks for correcting me.
|
Bruno Haible <haible>![]() ![]() |
Wed 03 May 2017 07:09:44 PM UTC, comment #3: (To be clear, the difference is the backticks) |
Philip Chimento <ptomato> |
Wed 03 May 2017 07:08:57 PM UTC, comment #2: You might be misunderstanding my motivation for filing this bug report. Believe me I know the problems of format strings getting mangled by translators no matter the programming language, so that's not what the bug report was about
|
Philip Chimento <ptomato> |
Wed 03 May 2017 03:15:21 PM UTC, comment #1: I will close this as "Not a bug" and merely document that only simple variable names should be used in braces.
|
Bruno Haible <haible>![]() ![]() |
Tue 02 May 2017 11:14:55 PM UTC, original submission:
In the latest Javascript specification, the language has gained interpolated strings:
|
Philip Chimento <ptomato> |
Depends on the following items: None found
Items that depend on this one: None found
There are 405 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 25 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2023-01-04 | haible | Status | Fixed | ![]() |
Fix Released |
2019-09-25 | haible | Status | Confirmed | ![]() |
Fixed |
Open/Closed | Open | ![]() |
Closed | ||
2019-09-25 | haible | Status | Fixed | ![]() |
Confirmed |
Open/Closed | Closed | ![]() |
Open | ||
2019-04-08 | haible | Status | None | ![]() |
Fixed |
Assigned to | None | ![]() |
haible | ||
Open/Closed | Open | ![]() |
Closed | ||
2018-09-13 | michaelgruber | Carbon-Copy | - | ![]() |
Added michaelgruber |
2018-09-07 | trevinho | Attached File | - | ![]() |
Added 0001-javascript-add-support-for-ES6-template-strings.patch, #44949 |
Attached File | - | ![]() |
Added 0002-javascript-do-not-translate-template-strings-wit-pla.patch, #44950 | ||
2018-09-05 | piotrdrag | Carbon-Copy | - | ![]() |
Added piotrdrag |
2018-07-25 | dmosberger | Carbon-Copy | - | ![]() |
Added dmosberger |
2018-07-05 | zumoshi | Carbon-Copy | - | ![]() |
Added zumoshi |
2018-01-31 | vslavik | Carbon-Copy | - | ![]() |
Added vslavik |
2018-01-16 | erickwilder | Carbon-Copy | - | ![]() |
Added erickwilder |
2018-01-05 | haible | Severity | 3 - Normal | ![]() |
4 - Important |
2017-10-04 | nterray | Carbon-Copy | - | ![]() |
Added nterray |
2017-10-03 | weekens | Carbon-Copy | - | ![]() |
Added weekens |
2017-05-03 | haible | Severity | 1 - Wish | ![]() |
3 - Normal |
Status | Not a Bug | ![]() |
None | ||
Assigned to | haible | ![]() |
None | ||
Summary | Javascript interpolated strings in xgettext | ![]() |
support Javascript template strings in xgettext | ||
2017-05-03 | haible | Status | None | ![]() |
Not a Bug |
Assigned to | None | ![]() |
haible |
As the two test cases that you are showing use a combination of template strings (standardized in ECMAscript) and JSX (not standardized in ECMAscript, cf. bug #57927), I would prefer if you could open a new ticket.