Modify standard HTML filter so it picks up some attributes in other tags?
Thread poster: Michael torhan (X)
Michael torhan (X)
Michael torhan (X)
United States
Local time: 05:02
Spanish to English
+ ...
Jul 27, 2015

Greetings,

I just finished (well, almost) a large website and there are a few items that I see still need to be translated, but they were never presented to me in DVX3.

It turns out that for the HTML "input" tag has an optional attribute "placeholder=", and this attribute was never picked up as a translatable item.

I'm a former tech guy, so maybe there is a way to tweak the standard HTML filter so that it picks up this attribute? I'd rather not have to go i
... See more
Greetings,

I just finished (well, almost) a large website and there are a few items that I see still need to be translated, but they were never presented to me in DVX3.

It turns out that for the HTML "input" tag has an optional attribute "placeholder=", and this attribute was never picked up as a translatable item.

I'm a former tech guy, so maybe there is a way to tweak the standard HTML filter so that it picks up this attribute? I'd rather not have to go into the affected DVX3-generated HTML files and manually do the translation because I won't be able to easily repeat the process later when the client makes changes.

Is there a way to pick up this attribute? Or a reason why it was omitted?

Thanks. Mike

[Edited at 2015-07-27 19:18 GMT]

[Edited at 2015-07-27 19:19 GMT]
Collapse


 
Epameinondas Soufleros
Epameinondas Soufleros  Identity Verified
Greece
Local time: 14:02
Member (2008)
English to Greek
+ ...
DejaVu's HMTL filter is awful Jul 27, 2015

According to my experience, DejaVu has a terrible HTML filter. In my case, when exporting an HTML translated into Greek, it exports every single character as an HTML entity... Even if I haven't checked the corresponding option in the export settings!

So, I doubt it can do what you need, which is more 'sophisticated'.

[Edited at 2015-07-27 22:41 GMT]


 
Endre Both
Endre Both  Identity Verified
Germany
Local time: 13:02
English to German
Try the XML filter Jul 28, 2015

DéjáVu's HTML filter unfortunately has virtually no options, in particular none to import specific attributes. The options I see are as follows:

1.
You convert the placeholder attribute to an alt attribute whose text the HTML filter imports (at least in certain types of tags: img and input yes, p no). You'd have to make sure you have a way of converting the alt attributes back to placeholder after export. If you don't have any other alt attributes in the file, a simpl
... See more
DéjáVu's HTML filter unfortunately has virtually no options, in particular none to import specific attributes. The options I see are as follows:

1.
You convert the placeholder attribute to an alt attribute whose text the HTML filter imports (at least in certain types of tags: img and input yes, p no). You'd have to make sure you have a way of converting the alt attributes back to placeholder after export. If you don't have any other alt attributes in the file, a simple regex search and replace is sufficient, but if you have (mostly in img tags), you might have to analyse the HTML tree structure to only convert back the alt attributes in the input tags, not img tags. You'd have to do some programming for that.

2.
Use the XML filter. You can create XML filters from scratch that give you fine-grained control over what attributes to import. But the HTML file would have to be in XHTML format for that. The XML filter chokes for example on the unclosed input tags typical of HTML that is not XML-compliant.

3.
Do some preprocessing on the input files to extract the attributes to a (temporary) tag that is picked up by the HTML filter. Again, this would require programming.

All of the above is only really practical for future files, not already imported ones as you'd have to reimport and retranslate them from the TM.

4.
For already imported files, what you can do is edit the tags (which contain the attributes) manually (highlight the code and hit Shift-F6). Not very convenient but if you have only very few occurrences in an otherwise huge file that would be a pain to reimport and retranslate, then maybe it could be done.

Endre
Collapse


 


To report site rules violations or get help, contact a site moderator:

Moderator(s) of this forum
Pavel Tsvetkov[Call to this topic]

You can also contact site staff by submitting a support request »

Modify standard HTML filter so it picks up some attributes in other tags?






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »