Batch translating files in XYplorer

Discussion in 'Interesting/Unrelated' started by vanTorX, Mar 3, 2020.

  1. vanTorX

    vanTorX Member

    I have a folder with thousands of files and the file names are in Korean 'picture language'. I translated several tens of them using Google translate and was looking for some better way to handle this.

    bphlpt advice in Shout box didn't pan out for various reasons and I was almost resigned to continue with the piecemeal translation until I noticed pretty comprehensive Renaming context menu in XYplorer that I have been using all along on this project. Pictures are the best illustration here of the whole process.

    00.png

    Paste the clipboard into Google Translate and copy the translated file names in bulk.
    BTW it falsely identifies the lang., it is Korean, not Chinese but nevertheless translates it nicely. 0.png

    Back in XYplorer, right click on the selection...
    1.png


    In the panel that pops up, select all files and paste in the translated equivalent from GT. This replaces the Korean named files with the English ones as you see it in the next snapshot.
    2.png

    Korean files replaced with English ones in the file renaming dialog window.
    3.png


    Clicking OK shows the preview of the renaming (in green font).
    4.png

    In this panel which shows the files in green font, you can check if everything is as you want it and you can return to the previous panel (via 'Edit Pattern' button) to edit the file names.

    Especially check for icon blanks - that means the file extension is either missing the needed period or there is a space inserted after the period or even the whole extension is missing! That does happen for some reason in Google bulk translate process with some files.

    In that case you can return to the previous panel and add in the extensions by hand. I found that with .bmp files, if you rename in XYplorer with non-valid extension, the file won't open in image viewers even if subsequently you rename the file to add in the .bmp extension. Somehow the file is damaged. I know its weird but that's how I found it to be. The same might happen with any other files but I didn't test that.

    XYplorer is simply amazing, you just need to learn what it can do. Big thanks to Trouba who made me give XYplorer second look after sending me it in ppApp form sometimes last year.
     
    Last edited: Mar 21, 2020
  2. bphlpt

    bphlpt A lowly staff member Staff Member

    Good to know! Thanks for sharing the details.
     
  3. vanTorX

    vanTorX Member

    It works, I just translated 118 folders in one fell swoop and in no time. I don't think I'd have the gumption to do it piecemeal, especially when this is just a small fraction. The whole collection is simply huge and if not translated, you simply get lost in it since it has deep folder nesting and with the Korean symbols, you don't remember any file names.

    Even un-raring was a job, ran a recursive un-rar but it missed some sections, I suppose it got stopped by some 'obstacle' in the path, perhaps some symbol Koreans used or something.

    One thing for working in XYplorer - for job like this, you need to turn off 'file selection by mouseover' if that's what you use, so your selection sticks through the renaming/translating process.
     
    bphlpt likes this.
  4. vanTorX

    vanTorX Member

    I have a related follow up, this time working with ripped CD audio files.
    I ripped audio books, each book on multiple CDs, mostly 5 or 6 CDs each and that resulted in folder for each CD, each with its own m3u playlist and numbered 1-x.

    I ripped some 30 audio books at ~5CDs each, and the ripping itself is just a tiny part of the work with it, as you might know if you sometimes did such thing.

    Those CD folders for each book then need to be merged into one, with one master m3u playlist, and (re)numbered sequentially. I selected all files in a folder and copied all file names into Notepad2 where you can do a column selection style by holding Alt and mouse drag. I discovered this column selection ability almost by accident and found that to be eminently useful for the task at hand.
    I prepared another text file with numbers 01-99 and 001-199 where I could copy the number style needed and paste it over selected column of numbers of audio files.

    Still, I needed to edit file names too, not just their numbering and the usual programs for batch renaming weren't suitable for that. By another stroke of luck, I found Notepad++ (which I was ignoring up to now, thinking Notepad2 is good enough for my needs) and discovered it has even more nifty ability to select and replace. It has even more versatile column selection but on top of that, it can rewrite all instances of a given word(s) in the file list when you change one of them by hand typing.
    It is fall off, or should I say bonus feature, from programming side of the Notepad++ since it is chiefly programmers coding work pad but its special code editing abilities can be used for other purposes, as in my case in text editing.

    From now on, Notepad++ will replace Notepad2 on my windows PCs. BTW it has very nice color interface, blue line numbers with yellow letters on black background and selections are red, which looks very much Chinese style but looks sharp, also has tabs...

    One feature of Notepad++ is puzzling me - you can drag tab over editing pane and select in the menu that pops up to clone the document, which gives you two views on it (in two panes next to each other), and editing either side automatically mirrors the edits in the other. I fail to see what it is good for, the feature baffles me. Recently I started to learn some coding in C# language, so I have some notion about code editing but it is still a puzzle.
     
    Last edited: May 22, 2020
    bphlpt likes this.
  5. vanTorX

    vanTorX Member

    I just checked and the Notepad++ from the official download doesn't have the colorful style of the one which I got as part of TotalCommander UP explorer that includes many programs with it, including this one.

    upload_2020-5-21_0-39-9.png
     
    The Freezer likes this.
  6. DonDamm

    DonDamm Guest

    Hi, vanTorX. A couple of things I notice, first I believe you can change the colors in Notepad++ very easily using the Style Configurator under Settings. there's quite a long list of pre-configured styles, but you can alter the default if you wish. Check the version you got with TC and see if is the default or whether they added a Style. I love the thing. I use both it and Notepad2 (sometimes Notepad3) all the time.

    Regarding the translation, that seems like a lot of work! I use all three, MS Trans (bing, I think), Google trans, and generally better in the languages I use often (German, French, & Spanish) - DeepL.com. All of them allow a limit of 5000 characters at a time which means you can copy a larger block of filenames at a time. As for being Korean, I'm not sure as it looks Chinese to me. Korean went through many changes and had three major versions based on Chinese characters before the modern era going way back to the 4th century or so. Their alphabet goes back to the 15th century, and today is known as Hangeul which looks like this . . .
    [​IMG] I know it makes little difference as long as you can get recognizable filenames that you can read. I know the translators can make goofs, but Chinese and Korean, ummm I don't know. Seems unlikely to me. Of course, Japanese is also based on Chinese characters and formal Japanese used the same characters with different pronunciations and meanings. I assume the same was somewhat true for Korea. Anyway, glad you got it sorted. I've used XYexplorer before, but never looked at it closely. Thanks for the tip. :^) -DD
     
  7. vanTorX

    vanTorX Member

    DonDamm, didn't check back on the post till now. I did make a stab to imitate the theme in the official edition but failed, then checked back with the TC UP edition and it seems the theme is their custom one coded in or what, as default, not accessible to examination to copy it in the official edition of notepad++

    TC UP edition of this notepad also has a distinct *.html file text colors and who knows what theme colors it has when you write some code in it or whatever. Easiest is to just use the one from TC UP of which I get portabilized edition once in a while from FileCatchers forum. It includes other nifty programs like Captura, MyPhoneExplorer and others plus some that are here in apz repo. Also I keep some programs from older editions that were dropped from TC UP, like LightAlloy audio player because it looks damn nice besides having nice controls... you see, I am sucker for looks, not just functionality, as long as the latter is also there.

    The translation is still some work but just a fraction of what it would be otherwise. I didn't run into any limit of text translation yet, it seems though, you can't always rely on proper language identification with some languages. I believe now, the text I was translating was Chinese Simplified. In Notepad++ I had to set encoding to UTF-8 and language Chinese Simplified in order to produce 'asian looking' text which would then be also translatable. Took me a while to find this encoding setting combination for text files to display properly.

    BTW I don't use TC Ultima Prime at all as an explorer, only use the portable apps that come with it. As to XYplorer, it has tons of features, like just the other day, I typed by accident '1' and it highlighted all 1s in the file view yellow. No idea what that means, it is called something 'type ahead' and probably is some kind of search, no idea yet how to use, I failed looking it up in the help file.
     
    Last edited: Aug 3, 2020

Share This Page