Allow translation of notes #627

Closed
opened 2023-09-03 19:18:22 +00:00 by fernandoporazzi · 0 comments
Contributor

Is your feature request related to a problem? Please describe.
It would be nice to allow users to translate notes to their preferred language.

Describe the solution you'd like
After a note is loaded, it would be nice to present the users a little button/link that when clicked translates the text contents of a note.

Additional context
Google Translate provides an API that should be easy to implement, something like the following would suffice to actually translated the text contents using the API.

async translate(text: string, target: string) {
  let res = await axios.post(
  `https://translation.googleapis.com/language/translate/v2?key=${API_KEY}`,
  { q: text, target }
  );
  return res.data.data.translations[0].translatedText;
}

const translatedContent = await translate("Hello world", window.navigator.language);
**Is your feature request related to a problem? Please describe.** It would be nice to allow users to translate notes to their preferred language. **Describe the solution you'd like** After a note is loaded, it would be nice to present the users a little button/link that when clicked translates the text contents of a note. **Additional context** Google Translate provides an API that should be easy to implement, something like the following would suffice to actually translated the text contents using the API. ```ts async translate(text: string, target: string) { let res = await axios.post( `https://translation.googleapis.com/language/translate/v2?key=${API_KEY}`, { q: text, target } ); return res.data.data.translations[0].translatedText; } const translatedContent = await translate("Hello world", window.navigator.language); ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Kieran/snort#627
No description provided.