Modify standard HTML filter so it picks up some attributes in other tags?
Thread poster: Michael torhan

Michael torhan
United States
Local time: 04:04
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 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]


Direct link Reply with quote
 

Epameinondas Soufleros  Identity Verified
Greece
Local time: 14:04
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]


Direct link Reply with quote
 

Endre Both  Identity Verified
Germany
Local time: 13:04
Member (2002)
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 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


Direct link Reply with quote
 


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?

Advanced search






SDL Trados Studio 2017 only €415 / $495
Get the cheapest prices for SDL Trados Studio 2017 on ProZ.com

Join this translator’s group buy brought to you by ProZ.com and buy SDL Trados Studio 2017 Freelance for only €415 / $495 / £325 / ¥60,000 You will also receive FREE access to our getting started eLearning program!

More info »
SDL Trados Studio 2017 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search