Skip to content

Translate fails to run on Windows #19

@vds2212

Description

@vds2212

I'm running on Windows 10 and bash is available on my system.

When the library is running on my system any call to translate launch a process of the kind:

C:\Windows\system32\cmd.exe /c (^(C:\Windows\system32\cmd.exe C:\Users\vds\AppData\Local\Temp\VWS6C41.tmp^) ^>C:\Users\vds\AppData\Local\Temp\V3F6C42.tmp 2^>^&1)

That doesn't return.
To solve the problem I have disabled the translation for win32 systems:

function! s:translate(id) dict abort
  let cache = lh#dict#let(s:k_cached_translations, self._env.LANG .'.'. self._env.TEXTDOMAIN, {})
  if !has_key(cache, a:id)
    if executable('bash') && !has('win32')
      let cache[a:id] = lh#os#system('bash -c '.shellescape('echo $"'.a:id.'"'), self._env)
    else
      " TODO: support windows
      let cache[a:id] = a:id
    endif
  endif
  return cache[a:id]
endfunction

Let me know if you would be interested by a Pull Request.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions