translate-shell icon indicating copy to clipboard operation
translate-shell copied to clipboard

Adaptation for windows

Open elig0n opened this issue 6 years ago • 5 comments

Since 'awk' 'curl' and other requirements are readily available in PE-executable form for Windows systems, can translate-shell be adapted for a windows version using batch/powershell instead of bash ?

elig0n avatar Jan 20 '20 05:01 elig0n

I'm not sure how to replace requirements with PE files. But Docker is available for the way to use translate-shell on Windows. For a instance, this project is executable on Cmd/PowerShell.

filtermap/docker-compose-trans https://github.com/filtermap/docker-compose-trans

filtermap avatar Jan 20 '20 09:01 filtermap

Isn't bash just as well available on Windows 10 then? What's the point of solely removing the dependency on bash while it still has to rely on Unix-style tools like awk and curl?

soimort avatar Jan 20 '20 10:01 soimort

Isn't bash just as well available on Windows 10 then? What's the point of solely removing the dependency on bash while it still has to rely on Unix-style tools like awk and curl?

If I'm not mistaken bash only comes with and run under wsl/cygwin/etc and has a lot ofbdependencies so it's not as compact as the other utilities. And then running it from native cmd has its uses.

elig0n avatar Jan 22 '20 14:01 elig0n

I'm not sure how to replace requirements with PE files. But Docker is available for the way to use translate-shell on Windows. For a instance, this project is executable on Cmd/PowerShell.

filtermap/docker-compose-trans https://github.com/filtermap/docker-compose-trans

if the requirements are on the PATH they can be simply called as they are.

elig0n avatar Jan 22 '20 14:01 elig0n

If you have gawk in PATH, you may clone the repository here and invoke it without bash at all:

> gawk -f translate.awk -- Bonjour

However, I believe this won't work on Windows native cmd if you don't run on a proper POSIX layer (Cygwin, MinGW, WSL). translate-shell was not designed for non-POSIX platforms from the very beginning: It assumes common *nix utilities such as POSIX-style echo and hexdump; you'll need to have those compiled as PE-executables too. Furthermore, things like ANSI escaped colors, will be completely messed up on a Windows console.

I'm not likely to spend time on fixing all those issues for non-POSIX systems. It makes a lot of sense for Windows users to just use WSL, I think.

soimort avatar Jan 22 '20 17:01 soimort