How to translate the alternative text of images in Trados

Hello!

A client of mine exported a CSV file (separated by ; and with " as string delimiter) from his website for translation, and I really can't create a rule to translate the text in the img alt tag.

Ex.

4615;"Let's talk about water [infographic]";"[DO NOT TRANSLATE]";"[DO NOT TRANSLATE]";"<p>It sounds pretty obvious that you can't live without a lot of water.<br />But how much water do you need, actually?</p><p><img alt=""This is a huge amount of water"" src=""/site/assets/files/4615/i_need_water_2021_1.jpg"" width=""1600"" /><img alt=""Another picture of water"" src=""/site/assets/files/4615/ocean_2021_2.jpg"" width=""1600"" /><a href="""></a></p>";"[DO">www.lotofwater.com/.../p>";"[DO NOT TRANSLATE]";"[DO NOT TRANSLATE]";"[DO NOT TRANSLATE]";"[DO NOT TRANSLATE]"

As I couldn't translate the CSV file using the CSV filetype (there is more than one column to translate) nor the TXT filetype (for segmentation issues), I chose to save it as XLSX.

I took off the standard tag definition rules and added a rule for every single tag, as the standard rule covers the alt img tag.

Now, I want to translate the alternative text (in orange) creating a tag pair with the rest of the tag, but I can't find a rule for that.

I tried with this:

[\<]+[^\"]+\"

+

[\""]+[^\>]+\>

But the second part begins from the first couple of "".

What is the right way to create this rule?

Parents
  • You've got to love these localization friendly clients ;-)

    Your rule is far too generic.  For example, this is what you capture with your opening expression:

    This with your closing:

    You are going to end up with a lot of overlap and probably error messages as well.  To create a rule specifically for this part you could try something like this:

    Opening:

    <img[^"]+""

    Closing:

    (?<=<img[^"]+"".*)""

    A bit messy perhaps but it should do this:

    Opening:

    Closing:

    The closing search on its own picks up more than needed but as this is intended to be used with the opening tag I think it'll be ok.  You could probably refine it if you really wanted to but hopefully this will give you the idea what what it means to add a rule for every single type of tag.

    So I did quick test..

    Also make sure you set the segmentation for the rule to exclude, and it looks like this:

    So does the trick.  Now I'd just need the other rules... which I'm sure you have sorted.

  • In fact I added a few more rules and changed the one I gave you:

    Screenshot of Trados Studio showing tag definition rules with various expressions and their corresponding tag types and translation settings.

    Looks a lot cleaner apart from the last bit which I deliberately left in:

    Preview of an Excel file in Trados Studio with text segments in two columns, original and translated, highlighting a URL that should not be translated.

    I left it in because this simply looks wrong and if it was me I'd go back to my client and check:

     [DO">www.lotofwater.com/.../p>

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:39 AM (GMT 0) on 5 Mar 2024]
Reply Children