angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Is any solution to add Comments for translation in attribute?

Open swayf opened this issue 10 years ago • 5 comments

for this situation :

<td data-title="{{'some Title' | translate}}"> </td>

swayf avatar Aug 07 '14 13:08 swayf

Not yet. I'd love to have it, but I'm not sure what it'd look like / how it would work.

rubenv avatar Aug 07 '14 13:08 rubenv

simplest solution that can be added easily is:

<td data-title="{{'some Title' | translate:'comment 123'}}"> </td>

But not sure if it is good idea :)

swayf avatar Aug 07 '14 14:08 swayf

Solution to this would be great, especially placeholders, ... are hard to catch without comments.

AntonTrapp avatar Aug 26 '14 15:08 AntonTrapp

Only issue is if there are other parameters you'd want to pass to the translate filter. For example, maybe you want to stick plural support as a filter param.

gabegorelick avatar Nov 14 '14 21:11 gabegorelick

1.5 years later, I run into the exact same issue.

One idea comes to mind:

Maybe the filter could look for a comment NEXT to it in the source, something like:

<!-- /// Something something, hush hush! -->
{{ 'This is just an example. Foo. Bar!' | translate }}

Similar to https://api.jquery.com/prev/

rebers avatar Apr 05 '16 16:04 rebers