angular-gettext
angular-gettext copied to clipboard
Is any solution to add Comments for translation in attribute?
for this situation :
<td data-title="{{'some Title' | translate}}"> </td>
Not yet. I'd love to have it, but I'm not sure what it'd look like / how it would work.
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 :)
Solution to this would be great, especially placeholders, ... are hard to catch without comments.
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.
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/