Translate Inline

approved

by Lucas Langholf

Translations at your fingertips. Inline Translations for your Notes.

2 stars632 downloadsUpdated 2y agoMIT
View on GitHub

Obsidian Translate Inline

Created with the help of the Obsidian Plugin Template.

With this plugin you get translations at your fingertips. Translate words or entire sentences with a minimal interruption of your thought process! For example, to translate from an auto-detected language to your default target language, you can simply type:

[>Buenos días] # Translate using your default settings

As soon as the cursor leaves the square brackets, the translation provider of your choice will be queried and the text will be replaced with the translation.

You may also specify the target language inline to use a different language than the default:

[>de>Buenos días] # Translate from the default source language to German

Or specify the source language, if it is not auto-detected:

[es>de>Buenos días] # Translate from Spanish to German
[es>Buenos días] # Translate from Spanish to your default language

Translation Providers.

To use this plugin, you need to have an API key from a supported translation provider. Currently, the plugin supports:

  • DeepL
  • Google Cloud Translation Both of these providers offer a free tier. While Google supports much more languages, DeepL is much easier to set up if you are not already familiar with Google Cloud.

Privacy

It should be self evident that the text you translate is sent to the translation provider of your choice, so their privacy policy applies:

Further Development

This plugin is in an early "works-for-me" stage of development. For now, "works-for-me" is exactly what I need and I will only fix bugs and maybe add mobile support. If you encounter any bugs, feel free to open an issue or a pull request. If this plugin proves to be useful to others, I do have some ideas for future features and enhancements:

  • Fancy Syntax Highlighting
  • Passing options to the translation provider (e.g. a formality setting for DeepL by using something like [>some text|formality:less])
  • Inline Dropdowns for language selection
  • Encrypted API key storage (though this would require a good solution for mobile support)
  • Option to customize the syntax aka. the divider and enclose characters.
  • Possibility to trigger translation by hitting enter or tab within the square bracket.
  • More Translation Providers

Addings more Translation Providers should be relatively easy, as the plugin is designed to be modular. If you are interested in adding a translation provider, have a look at an exisiting provider like Google, implement the same interface and add it to the provider factory. Furthermore, update the README including the privacy policy of the new provider.

Support Me!

If you find this plugin to be of any use to you, I would be grateful if you would buy me some time to do more like this: "Buy Me A Coffee"

Developmen References:

This is a list of resources and inspirations I used to create this plugin:

Other Translation Plugins:

Plugins that use Editor Extensions:

Plugins that use SafeStorage:

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.