1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any free tools that can translate bulk txt files?

Discussion in 'BlackHat Lounge' started by karupoiss, Jun 27, 2015.

  1. karupoiss

    karupoiss Elite Member

    Joined:
    May 16, 2012
    Messages:
    1,797
    Likes Received:
    565
    Gender:
    Male
    Location:
    Europe
    Home Page:
    Hey!

    I need a tool that can take in multiple .txt files and translate them to some other language and save them as separate .txt files. Anything out there?
     
  2. eXampL

    eXampL Power Member

    Joined:
    Jan 24, 2015
    Messages:
    511
    Likes Received:
    368
    How many files do you have? If you have only a few you can drag and drop each txt in chrome and use that "right-click -> translate" thing and then "richt-click -> save as..."
    You can also do a quick script with iMacros for Chrome if you have too many files.
    Hope it helps
     
  3. karupoiss

    karupoiss Elite Member

    Joined:
    May 16, 2012
    Messages:
    1,797
    Likes Received:
    565
    Gender:
    Male
    Location:
    Europe
    Home Page:
    I have like couple .. hundred.. thousand.. files :D I might give this way a shot with imacros if I can't find anything else but I'd like an easier way :D
     
  4. eXampL

    eXampL Power Member

    Joined:
    Jan 24, 2015
    Messages:
    511
    Likes Received:
    368
    • Thanks Thanks x 1
  5. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    6,953
    Likes Received:
    7,985
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    if imacros would have tits, i wouldn't even need a woman anymore lol

    here ya go, i just quickly put together the imacros code for the Sire:
    HTML:
    VERSION BUILD=8920312 RECORDER=FX
    TAB T=1
    TAB CLOSEALLOTHERS
    SET !ERRORIGNORE YES
    SET !LOOP 1
    SET !DATASOURCE C:\({{!LOOP}}).txt
    SET !DATASOURCE_LINE {{!LOOP}}
    URL GOTO=https://translate.google.com/
    TAG POS=1 TYPE=DIV ATTR=TXT:English
    WAIT SECONDS=2
    TAG POS=2 TYPE=DIV ATTR=TXT:Spanish
    WAIT SECONDS=2
    TAG POS=1 TYPE=TEXTAREA FORM=ID:gt-form ATTR=ID:source CONTENT={{!COL1}}
    WAIT SECONDS=2
    TAG POS=1 TYPE=SPAN ATTR=ID:result_box EXTRACT=TXT
    SAVEAS TYPE=EXTRACT FOLDER=C:\ FILE=({{!LOOP}})+.txt
    WAIT SECONDS=1
    i used the FF addon, it may or may not work with the standalone version
    the only thing you should do is mass rename your .txt files to (1).txt, (2.).txt, (3).txt and so on, it can be easily done with total commander ultima prime i'm using for instance, maybe even with the regular total commander too
    the file path is set to the root of your C: drive

    obviously change the languages, file paths and tweak the delays to your liking
     
    • Thanks Thanks x 1
  6. karupoiss

    karupoiss Elite Member

    Joined:
    May 16, 2012
    Messages:
    1,797
    Likes Received:
    565
    Gender:
    Male
    Location:
    Europe
    Home Page:
    I have played around with this code now but it doesn't quite work like I'd like to. It doesn't choose the languages (that's not a big deal as I can set them automatically and they stay the same). The thing that doesn't work though is that it picks the first sentence of the file, translates it but disregards everything else. My second line is an empty line. From the second file it just saved "" marks even though the first sentence doesn't have any "" marks and the third file it translated and saved only the first sentence again.