Closed (fixed)
Project:
Translation Template Extractor (potx)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Nov 2015 at 09:41 UTC
Updated:
23 Nov 2015 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gábor hojtsyComment #3
gábor hojtsyComment #5
gábor hojtsyI tried finding some proof on whether this should be identified in the first place (based on API docs), but the allowed characters do not seem to be identified in the API docs.
Comment #6
gábor hojtsyDid it depend on the filter?
Comment #7
gábor hojtsyAham, so extra filters will not be found rather :D However based on #2547639: Rename ambiguous "Menu" toggle in Bartik for accessibility, those would not work in trans anyway. So what should potx do is do throw a warning that the use of the trans block this way is pointless and skip the string entirely instead of detecting it in the wrong way.
Comment #8
gábor hojtsyComment #9
gábor hojtsyComment #11
gábor hojtsySo this is a bit complex... Core's TwigTransTokenParser allows filters and getattr, and a couple other thigns:
However in TwigNodeTrans, only the placeholder filter is explicitly supported. It does not seem to support any other filter.
So I think we should assume the @ prefix the same way TwigNodeTrans does and alter it if we find a placeholder marker. That would keep adding the variable name to the string even if an unexpected filter was found. Updated patch for this plus removing support for passthrough which was removed from core as well.
Comment #12
gábor hojtsyEven more tests.
Comment #13
gábor hojtsyOne more test combination for fun :D Not 100% sure we expect it to work this way.
Comment #15
gábor hojtsyOk, let's get this out.