Creating file type from IOS App strings file

I can't for the life of me figure out what I'm doing wrong here. Initially what I used below worked well, the only issue was that it didn't pull some text from 1 of 5 files. Now the client has added some new strings to the file that was already translated. When I do a preview of the new file all I see is the target text in the source area and none of the English untranslated strings show up. I created a new file by removing the strings that were already translated, preview the file, and nothing shows. I'm baffled as to why this worked a couple weeks ago and now it's not.

This is what I used initially and it worked well for the most part:
Opening pattern: "[^"]*"\s*=\s*"(?=[^"]*"\s*;)
Closing pattern: "\s*;
Multiline: False

Here's a sample of the file structure:
/* Class = "UIButton"; normalTitle = "Loading..."; ObjectID = "Mwc-2W-o5R"; */
"Mwc-2W-o5R.normalTitle" = "";

/* Class = "UITextField"; placeholder = "ex. Bonus Room"; ObjectID = "ohd-8e-5Vy"; */
"ohd-8e-5Vy.placeholder" = "";

/* Class = "UILabel"; text = "New Home"; ObjectID = "PLx-f7-Zqy"; */
"PLx-f7-Zqy.text" = "";

I'm using SDL Trados Studio 2021 - 16.0.1.2917

Thank you

  • If the sample text you provided is a real example representative of the file then perhaps the problem is that there is no translatable text in these strings based on that pattern?  You are picking out text from within these quotes:

    Screenshot of Trados Studio showing code with empty string values for UI elements such as UIButton, UITextField, and UILabel.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:34 AM (GMT 0) on 5 Mar 2024]
  • I'm using SDL Trados Studio 2021 - 16.0.1.2917

    You also need to upgrade!

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Thank you and yes, that is text copied from the actual file. The text to be translated is the English text in the line above: "Loading...", "ex. Bonus Room", "New Home" and the translated text is to be inserted where you've marked, between the ""

  • The text to be translated is the English text in the line above: "Loading...", "ex. Bonus Room", "New Home" and the translated text is to be inserted where you've marked, between the ""

    In this case you've got some work to do first!  The regex delimited filetype we have is monolingual and not bilingual.  So this means that for the expressions you are using the translatable text needs to be between the quotes now.  Then the filetype will extract it and replace it when you translate it.

    So your options are these:

    1. ask your customer if they can provide the file with the translatable text in the right place now, OR
    2. use a bit of regex magic in a decent text editor to copy the translatable text into the right place, OR
    3. engage a developer to create a filetype to handle these sort of files

    The 3rd one is sensible if you get a lot and it's repetitive work from this customer.  The investment would soon pay for itself and it's probably fairly trivial for a competent developer so may not be too expensive either.

    The 2nd one will take some work as you'll need to identify all the attributes containing the translatable text for your regex rules.  You have three segments here and each one uses a different attribute in a string containing several attributes.  So no simple consistency to rely on UNLESS it's always the 2nd attribute in that row, in which case a single rule would do it for you.

    The first one... clearly the most economical... all depends on your relationship with, and the capability of, your customer.

    Another option might be Passolo... would know better.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub