Creating filetype and Regex to translate JS file

Hello, 

hope you are sound and safe.

I would like to guide me how to create a file type to translate the attached *.js file.  and please help me to identify the correct regex to appear only the translatable text which is between duple quote  " "

I'm using SDLTrados studio 2019

0167.InteractionEvents.rar

Thanks in advance

Samar

Parents
  • Hello 

    To do this, please go to File Options- New

    Trados Studio Options window showing File Types list with various file type extensions.

    and select Regular Expression Delimited Text- OK

    Select Type dialog box with Regular Expression Delimited Text option highlighted.

    Provide a file type name- ensuring this is identical to the file type identifier and change File dialog wildcard expression to .js

    File type information window with fields for file type name and file dialog wildcard expression.

    Now open the newly created custom file type and delete the existing expression

    Document structure window with existing expression selected and a delete button highlighted.

    Now enter the following Opening pattern .+?" and closing pattern  ";$  (edited the opening pattern as it should be a dot not a comma)

    Document structure window with empty fields for opening and closing patterns.

    Now select Inline Tags/ Add rule {\d+}

    Inline Tags window with a new rule added for numerical placeholders.

    And browse to preview file as this should now work for you.

    Preview file window in Trados Studio showing correctly processed inline tags.

    Lydia Simplicio | 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:47 AM (GMT 0) on 5 Mar 2024]
Reply
  • Hello 

    To do this, please go to File Options- New

    Trados Studio Options window showing File Types list with various file type extensions.

    and select Regular Expression Delimited Text- OK

    Select Type dialog box with Regular Expression Delimited Text option highlighted.

    Provide a file type name- ensuring this is identical to the file type identifier and change File dialog wildcard expression to .js

    File type information window with fields for file type name and file dialog wildcard expression.

    Now open the newly created custom file type and delete the existing expression

    Document structure window with existing expression selected and a delete button highlighted.

    Now enter the following Opening pattern .+?" and closing pattern  ";$  (edited the opening pattern as it should be a dot not a comma)

    Document structure window with empty fields for opening and closing patterns.

    Now select Inline Tags/ Add rule {\d+}

    Inline Tags window with a new rule added for numerical placeholders.

    And browse to preview file as this should now work for you.

    Preview file window in Trados Studio showing correctly processed inline tags.

    Lydia Simplicio | 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:47 AM (GMT 0) on 5 Mar 2024]
Children