fevol / obsidian-translate Goto Github PK
View Code? Open in Web Editor NEWTranslate text and entire notes in Obsidian
License: MIT License
Translate text and entire notes in Obsidian
License: MIT License
Just an idea I had that could fits well with the plugin maybe?
So the plugin can already translate selected text into a different language. However, when I need to translate things, it's mostly more complicated words for which there are multiple possible translations.
What I could imagine would be to quickly cycle between the possible translations. So for example you select the word "grande" (french) and on the first run of the command, it becomes "big". run the command again, the word becomes "great", a third time, it becomes "tall".
That way, you could quickly cycle through possible translations (even without using the mouse) without having to look up all possible translations and then tediously copying or typing the translation you choose.
Currently there are two steps required to translate a selection from keyboard, opening the 'Translate Selection' command via hotkeys (or one additional step: via command palette), and then typing in the language.
Perhaps it would be convenient if you could just execute one shortcut to translate the selection, based on the language_to (target language) you have set inside the Translation View? Let me know what you think!
Implement client-side translation via Bergamot, requires minimal set-up for the user.
Description: Fast Text cannot be selected as the option filter services does not contain the item.
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.9"
obsidian_version: "1.1.12"
selected_service: "deepl"
After selecting the sync with spellchecker option, it
Description: The translation service dropdown is empty
The translation service dropdown menu is empty. And the unique service tab visible is "FastText Settings".
Thanks so much for your excellent work!
Francesc Rosés
plugin_version: "1.4.6"
platform: "macOS"
framework_version: "1.3.7"
obsidian_version: "1.4.2"
selected_service: undefined
plugin:obsidian-translate:42349 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'default_usage')
at setupLanguageDetector (plugin:obsidian-translate:42349:47)
at setupTranslationService (plugin:obsidian-translate:42365:5)
at Object.$$self.$$.update (plugin:obsidian-translate:42596:27)
at init (plugin:obsidian-translate:1248:6)
at new Reactivity (plugin:obsidian-translate:42646:5)
at TranslatorPlugin.onload (plugin:obsidian-translate:42765:23)
The plugin cannot load the settings properly. The commands don't get loaded properly and after clicking on the Translate
Tab in the community plugins, it is empty, and every new settings tab is empty as well and throws this error:
plugin:obsidian-translate:42699 Uncaught TypeError: Cannot read properties of undefined (reading '$destroy')
at TranslatorSettingsTab.hide (plugin:obsidian-translate:42699:15)
at t.openTab (app.js:1:2063355)
at HTMLDivElement.<anonymous> (app.js:1:2062226)
Error when clicking on the translate tab:
plugin:obsidian-translate:27282 Uncaught TypeError: Cannot read properties of undefined (reading 'default_usage')
at Array.create_control_slot (plugin:obsidian-translate:27282:47)
at create_slot (plugin:obsidian-translate:515:29)
at create_fragment9 (plugin:obsidian-translate:2809:28)
at init (plugin:obsidian-translate:1251:41)
at new SettingItem (plugin:obsidian-translate:2927:9)
at create_fragment15 (plugin:obsidian-translate:27406:18)
at init (plugin:obsidian-translate:1251:41)
at new SettingsPage (plugin:obsidian-translate:28094:5)
at TranslatorSettingsTab.display (plugin:obsidian-translate:42687:17)
at t.openTab (app.js:1:2063766)
With a safe access (?
) in these two places, it works again.
It would be cool if the sidebar could execute the translation on mod-enter (ctrl-enter on windows/linux, cmd-enter on macOS).
Currently, the view gets attached to the containerEl. It has the effect that when dragging the sidebar view outside of the main window or into the root split of the main window, that there is no way to drag it back.
I would have made a PR, but as is visible in the second picture, the resizing is off when using contentEl and would need to be adjusted.
Current containerEl implementation:
When using contentEl:
58 sec demonstration:
https://www.loom.com/share/02d2ec2333564a3aabd91c9a785d392a
There are 10 different translation services, each having four different functions that could be called: 'validate, detect, translate, get languages', and each has multiple possible failure conditions, depending on API keys used, hosts,... It's getting quite tiresome to manually check every service when I do an overhaul of their code, so it's as good time as any to start writing automated tests with Jest.
Currently when one uses the translate selection to selected language command, a modal pops up.
Having to click the modal or press return is a pain when doing many translations in a row.
I would like a command that just translates directly into the last language used.
Thanks.
Hello,
I'd like that there is a command that translate to new line,don't change the selection text,insert the translation to new line.
Thanks!
I would appreciate if I could select all text with Ctrl
-A
. The reason for this is that I often copy text into it and would like to use that hotkey for selecting all the text that's already inside it.
So that I can Ctrl
-A
, Ctrl
-V
for inserting the new text.
It would be nice to have a button in the Translation view for copying the text from the translated text portion of the view.
Additionally, it would be good to have a shortcut key for the button.
Tnx!
With beta release 1.4.5 (accessible using BRAT), the OpenAI service has been added to the plugin, by recommendation of @ckt1031 and inspired by the OpenAI Translator Application.
I will be releasing this update by the end of the week. However, I am eagerly looking for any feedback for this service.
Specifically:
Some implementation details:
Identify the language of the input, please ONLY output its ISO639-1 code:\n INPUT
Translate following text to 'TARGET' without explanation, include ISO639-1 locale of the input in the first line:\n INPUT
Translate following text from 'SOURCE' to 'TARGET' without explanation:\n INPUT
In Glossary tab, enable the toggle button has no persistance.
I think is related to that glossary tab too:
If i fill a glossary term and add it in one direction doesn't fill the reverse pair after click at the "reverse" button.
So i need fill the two ways.
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "0.15.6"
obsidian_version: "1.1.9"
selected_service: "bergamot"
This will only happen once after changing the text, clicking the translate icon after that will not do anything.
SYSTEM INFO:
Obsidian version: v0.15.2
Installer version: v0.14.6
Operating system: Windows 10 Home 10.0.19043
Live preview: on
Legacy editor: off
Base theme: light
Community theme: Minimal
Snippets enabled: 7
Safe mode: off
Plugins installed: 34
Plugins enabled: 3
1: Hot Reload
2: Obsidian42 - BRAT
3: Translate - 1.1.4
You are making a plugin that runs in the same environment as code from other people, and doing something like this breaks String.format
for everyone else. This should be obvious, but I guess it was not.
Enjoying Obsidian Translate. Thank you for this tool!
It would be useful to assign default languages to the Translation View. So in settings, I can't say Language 1: is English, and Language 2: is Spanish, and Translation View always opens with those as defaults.
Tnx!
Description: ADD A SHORT DESCRIPTION HERE
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.9"
obsidian_version: "1.1.16"
Description: After to install fastText language model, this plugin saves the plugins list setup (which one is on or off), including the chosen theme and restores everything at obsidian startup.
So if you activate or deactivate plugins after activated this one, the changes will be "forgotten".
It's necessary activate obsidian-translate last if you want to avoid that.
1- Choose bergamot as the service
2- Install bergamot models
3- Install fastText
After that, whathever modifications will be discarded at restart.
Uninstall fastText or activate obsidian-translate last.
plugin_version: "1.4.3"
platform: "Desktop"
framework_version: "0.15.6"
obsidian_version: "1.1.9"
selected_service: "bergamot"
After installing this plugin and enabling it, I have got my "More options" menu broken. It doesn't scroll and has broken layout as long as the plugin is enabled. I have reproduced this bug on my usual vault and on newly created vault.
Here screenshot and video https://github.com/AntonTheDeveloper/bug-reports/tree/37e850c48cc6684c7a46d6734007621038b21d0e/obsidian-translate
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.16"
obsidian_version: "1.1.16"
selected_service: "google_translate"
obsidian-translate/src/main.ts
Lines 107 to 114 in d1ad096
Currently, the pane can only be opened when there is an editor in focus. But there doesn't need to be an editor for the translation pane to be useful.
Markdown formatting doesn't perfectly survive the translation process. The root of the issue lies mostly with the way that translation services handle and process text, so the solution will lie elsewhere. One possibility is applying post-processing to the output of the translation operation, fixing broken URL's, code blocks, etc.
(Request from Discord) Implement Youdao as a translation service
I would like to pass a word, source language, target language to the api and get back the translated word.
Probably the return value needs to be an array with the translation word and perhaps the descriptions of it.
Would that be possible?
Implement client-side language detection via the FastText library
Hey,
First thanks for an awesome plugin, I really needed that.
However, when trying to use Translate I ran into an issue. I put Translate in the sidebar, where I think it will be most beneficial for me, but when I use a hotkey or the command to open the Translate View, it won't go to the instance already in the sidebar but always open a new pane.
Is it possible to use an existing instance if one is already opened?
I added a GIF to better explain the issue.
Thanks in advance!
Description: ADD A SHORT DESCRIPTION HERE
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.16"
obsidian_version: "1.1.16"
Add localization support for the plugin's UI elements and translation service languages, the list of languages supported is the same as those supported by Obsidian's (see here)
IMPORTANT: Currently, the localization system is not fully set-up yet. If you'd like to contribute, please let me know that you're interested, and I'll try to get it sorted out as soon as possible.
If you'd like to add your language to the localizations, follow these steps:
.ts
file containing your language's ISO code in this directory, you can find the ISO code/language locale to which your language here)Description: ADD A SHORT DESCRIPTION HERE
plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.9"
obsidian_version: "1.1.16"
I'm using a custom deepl service as my translation engine in docker, can this plugin add a port to embrace this workflow?
Reference: CustomDeepL
Would you consider making the plugin available for mobile as well?
Translating on the go would be a huge win!
Thank you for looking into it.
Thank you.
Description: ADD A SHORT DESCRIPTION HERE
plugin_version: "1.4.4"
platform: "macOS"
framework_version: "1.1.9"
obsidian_version: "1.1.16"
Implement Lingva as a translation service, this service scrapes translations from Google Translate, without accessing any Google services
Probably not entirely legal
Hi,
I really want to integrate Translate into my keyboard-centric flow, and currently when opening the view, in order to start typing a word to translate I need to press Tab 4 times.
Is it possible to open the view with the 'Type here' box already focused and ready to go?
Thanks in advance!
Currently, the entire input gets sent to the selected translation service. If multiple translations are executed on a block of text (say, when the user is typing in the Translation View and they wish to check if their intermediate result is correct), the amount of characters sent to the service will grow exponentially - even more so if the user has auto translate enabled.
The solution for this problem is to only translate the new text. Below are some approaches that could be taken:
Cache translation results of the service
Only translate parts of the entered text that were changed
Hi,
just testing the plugin, but when I use my (free) Deepl API key, it says "failed to fetch".
Any idea?
BTW, any chance for the user to determine if he uses the pro API? I guess that is a different API domain.
Thanks!
(Request from Discord) Implement QQ as a translation service
Hi, thanks for building such a powerful translation plugin, I think it's more powerful than those in obsidian plugin market.
I just realize it's more convenient when reading translation and original text in one file, because most translations are not very accurate and we need to see original text to get the meaning.
Will you consider to add a feature, when doing a file translation, show translation result and original text paragraph by paragraph, for example:
when we translate an English file to Chinese, the file finally show like this:
Obsidian is a powerful and extensible knowledge base that works on top of your local folder of plain text files.
Obsidian 是一个强大且可扩展的知识库它适用于纯文本文件的本地文件夹。
Everything is connected
一切都已连接
The human brain is non-linear: we jump from idea to idea, all the time. Your second brain should work the same.
人脑是非线性的:我们总是从一个想法跳到另一个想法。你的第二个大脑应该同样工作。
In Obsidian, making and following connections is frictionless. Tend to your notes like a gardener; at the end of the day, sit back and marvel at your own knowledge graph.
在 Obsidian 中,建立和跟随连接是无摩擦的。像园丁一样照顾你的笔记;在一天结束时,坐下来惊叹于您自己的知识图谱。
I am not sure this is a feature most people will need or not but it's definitely a difficult and complicated feature. I don't know obsidian plugin system can realize this or not, if not, you can just pass my request.
The Translation View currently only displays text from LTR, and the logical flow of the interface likewise occurs in that order.
When exporting any note as PDF the compiled code for Yandex, and some additional code will be the first thing visible.
The code will also show up as the last thing in the DOM
Obsidian version: 0.15.3
Plugin version: 1.1.5
Description:
service_version: "1.0.0"
obsidian_version: "0.15.8"
mobile: false
Hi (long time no see). I haven't been using the plugin much lately for various reasons, but started up recently. One thing hanging me up is a snag with the lingva translator. It may not be with the plugin at all, but I find that in translating english to japanese, french and portuguese (the only languages I tested), paragraph breaks are not preserved, which was slowing me down. I don't konw if it something fixable on your end, but I thought I'd let you know. Aside from that, hope you are doing well...
Currently the API keys are stored in a plaintext file within the plugin's data.json. Some users might want a more secure solution, such that if their vault's files get leaked, the API keys of the translation services are (reasonably) protected.
I don't know what the most secure way to do this will be; and what people consider to be secure enough, so I'd love to hear your opinion on this matter!
Encrypt the API keys stored within data.json
with an user provided password, this password can be added in local storage such that the user does not need to re-enter it each time Obsidian is booted up
User needs to add API key for translation service every time plugin is started up (API key never gets saved on disk)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.