GithubHelp home page GithubHelp logo

Comments (10)

echuraev avatar echuraev commented on June 10, 2024

Hi @Rom888!

For this case you can use :TransSelectDirection or :TransInteractive. These functions are more comfortable when you are using them with bindings or with fzf.

For case to determine target language based on source language. It won't work every time. For example: word "gift" has another meaning in German. It means "poison". In this case using :TransSelectDirection will be more right approach.

What's wrong with using :TransSelectDirection or :TransInteractive?

from translate-shell.vim.

Rom888 avatar Rom888 commented on June 10, 2024

With :TransSelectDirection I have to select languages for each translation, this is not convenient.
In the case of ru-en, en-ru pairs, it is easy to determine source language, because the characters are completely different.
It would be nice, if the plugin could determine a source language using the characters from the selection and automatically select a direction from g:trans_directions_list.

from translate-shell.vim.

echuraev avatar echuraev commented on June 10, 2024

I think, it could work only with direction from variable g:trans_default_direction and only if both directions were determined e.g. let g:trans_default_direction = 'en:ru'.

In this case it will be easy to make an assumption about translate direction. But in case if there are several languages e.g. 'en:ru+de' maybe it just necessary to change order of languages. In case of translating Russian text it will be something like that: 'ru:en+de'.

I don't think that it will be a good idea to use g:trans_directions_list for determining translate direction because it can be many almost the same options there such as: 'en:ru', 'de:ru', 'en:ru+de'. And in this case if you would like to translate something from Russian, it will be difficult to make the right choice automatically.

Finally, thank you for very nice idea for feature. Personally, I usually use automatic determining of source language and just specify the target language. I'll take a look what can I do for this issue. Also, if you will have a time, you could try to do this feature and create a pull request.

Now maybe the better approach (till this feature is done) is using FZFTransSelectDirection or just change default direction for session by using :FZFTransChangeDefaultDirection when you want mostly translate from one specific language to another. I use :FZFTransChangeDefaultDirection mostly when I need to translate many Russian words to another language during one session. Did you try to use FZF functions?

from translate-shell.vim.

Rom888 avatar Rom888 commented on June 10, 2024

Egor, I agree that using g: trans_default_direction will be better than g: trans_directions_list, for reasons that have been voiced.
Today I installed and tried fzf for the shell and for Vim, these are really cool products!
I also tried the FZF functions of your plugin, but to be honest, it’s more convenient to use these keyboard layouts:

inoremap <silent> <leader>tr <ESC>:Trans :ru<CR>
nnoremap <silent> <leader>tr :Trans :ru<CR>
vnoremap <silent> <leader>tr :Trans :ru<CR>
inoremap <silent> <leader>te <ESC>:Trans :en<CR>
nnoremap <silent> <leader>te :Trans :en<CR>
vnoremap <silent> <leader>te :Trans :en<CR>

from translate-shell.vim.

LeoSol56 avatar LeoSol56 commented on June 10, 2024

Hello Egor,

Using PlugInstall, I installed " translate-shell.vim " in my NeoVim (NVIM v0. 3. 4). The installation was successful.

Now I want an open terminal with interactive translate-shell. To do this in nvim, I use the following command:
: TransTerm
In response from nvim, I get the following: "Trans unavailable! CMD: trans". I do not know what to do next.
I will be grateful for your help. Thanks.

PS. 1. My OS is Linux version 4.19.0-14-amd64 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.171-2 (2021-01-30)
2. In Linux, I am an unprofessional (5 months of experience). Therefore, I will be grateful for detailed explanations. Thanks.

Kind regards,
Leonid

from translate-shell.vim.

echuraev avatar echuraev commented on June 10, 2024

Hello Egor,

Using PlugInstall, I installed " translate-shell.vim " in my NeoVim (NVIM v0. 3. 4). The installation was successful.

Now I want an open terminal with interactive translate-shell. To do this in nvim, I use the following command:
: TransTerm
In response from nvim, I get the following: "Trans unavailable! CMD: trans". I do not know what to do next.
I will be grateful for your help. Thanks.

PS. 1. My OS is Linux version 4.19.0-14-amd64 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.171-2 (2021-01-30)
2. In Linux, I am an unprofessional (5 months of experience). Therefore, I will be grateful for detailed explanations. Thanks.

Kind regards,
Leonid

Hello Leonid,

It looks like you didn't install translate-shell on your system. Please take a look on this section: https://github.com/echuraev/translate-shell.vim#installation-with-vim-plug

You must download translate shell to your system: wget -O ~/.vim/trans git.io/trans && chmod +x ~/.vim/trans
And after that, specify the directory with executable file: let g:trans_bin = "~/.vim"

Also, there is another option, you can specify path to executable in your PATH environment variable and in this case it won't be necessary to use g:trans_bin.

from translate-shell.vim.

LeoSol56 avatar LeoSol56 commented on June 10, 2024

from translate-shell.vim.

LeoSol56 avatar LeoSol56 commented on June 10, 2024

from translate-shell.vim.

echuraev avatar echuraev commented on June 10, 2024

You forgot to specify path to executable of translate-shell.

And after that, specify the directory with executable file: let g:trans_bin = "~/.vim"

Also, there is another option, you can specify path to executable in your PATH environment variable and in this case it won't be necessary to use g:trans_bin.

from translate-shell.vim.

LeoSol56 avatar LeoSol56 commented on June 10, 2024

from translate-shell.vim.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.