Open bartbutler opened 8 years ago
Whoops, this is a repeat of #120, though perhaps slightly cleaner. Sorry.
@rubenv, forgive my ignorance, but the tests that fail here seem to be broken. For instance, there is stuff like this:
<h4 translate="translate">Translate this</h4>
From the current documentation (and logic) I would expect that if the user wanted to translate 'Translate this' they would use:
<h4 translate>Translate this</h4>
Made a special case for attribute translate = "translate", as I imagine there are existing codebases using this syntax.
You should include a test for this change. Then maybe it gets attention from @rubenv
When using a custom directive on an attribute, the extracted string should default to the value of the attribute, and if not present, fallback to the HTML inside the tag. For example, if I want to translate all my 'tooltip' attributes, and have some HTML like this:
<span tooltip="translate this">Not this</span>
The old extract.js would extract "Not this" instead. This change fixes this, while allowing "Not this" to be translated if desired by giving the attribute no value.