Regex for .js filetype

Dear colleagues
I have a js file to translate and I need to create a simple rule using regex to only display the content in Trados. 

I also want to exclude empty strings from displaying
"Site survey",
"Authentication type",
"This table shows the assigned IP address, MAC address and expiration time for each DHCP leased client.",
"Expiration time",
"Broadcast SSID",

Thanks for your help



    I guess you probably figured it out by now, but if not here's a settings file:

    I just created two rules:

    One to handle what gets extracted (it will ignore blanks by default with this rule):

    Screenshot showing the document structure rules to extract text from a suitable custom filetype

    A placeholder to handle the line break I spotted in your file:

    I also added *.js as a file dialog wildcard expression so it gets used when you open your *.js files.  Looks nice and clean:

    Screenshot showing a preview of the extracted text for translation.

    You can use the settings file by clicking on import settings when you're in the FileTypes node:

    Screenshot showing where to find the import settings button from the File Types menu.

  • Hi Paul
    Thanks for your reply, I thought I had got my filetype right but now I have another issue with the strings with content between \"text\" which displays partially in Trados. Key is correct Yes\.

    I've had a long discussion with ChatGPT but nothing is working. Can you please assist?

    "verifying key. Wait about 20 seconds for the result.",
    "Key is correct, you can click \"Yes\" button to setup the other band setting, or click \"No\" button to finish setting.", 
    "Key is correct, click \"Next\" button to continue.",
    "This repeater could not get the IP address from your root AP, you can retry or cancel to check your settings.",
    "Key is wrong, please double-check your wireless security key and input the correct key again then click \"Next\" button. Or you can back to site survey page to double-check whether you connect to the access point you want to use.",
    "Note: If you don't remember the wireless security key or this connection fails after several tries, we recommend you login to your access point firmware and change to a new wireless key.", "failed to get IP address.",
    "Please press \"APPLY\" button to restart the system for the changes to take effect.",
    "This section allows you to set up your Wireless-1200AC Managed AP Pro. Please select the mode you wish to use and click \"Next\".",
    "You may press \"CONTINUE\" button to continue configuring other setting or press \"APPLY\" button to restart the system for changes to take effect.",
    "You must press \"APPLY\" button to restart the system for changes to take effect."

    Well...  I have no idea what your filetype looks like now but all you really need to do is add a placeholder like this:


    What did you do?

Reply Children