Translation feature pukes out on some markdown elements or multiple paragraphs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 659
- Forks
- 133
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 110
Description
Describe the bug
Translate feature can't deal with most markup
To Reproduce
Steps to reproduce the behavior:
But seriously.
- Create a pagragraph of text, then add a
- [ ] stylebullet list, or a table or something more complicated, and another paragraph of text. - Select the 3 pagragraphs, click on '...' and choose translate
- select languages and translate
- Nothing happens
It does depend a bit on what you select, EG emoji's in a table will definitely be fun (...), try this:
| Feature | Other apps | Our app |
|---|---|---|
| AI based task sorting | ❌ | ✅ |
| Collaborative editing | ❌ | ✅ |
| Gamification | ❌ | ✅ |
| Location based reminders | ❌ | ✅ |
Plus a paragraph of text!
| Feature | Other apps | Our app |
|---------|------------|---------|
| AI based task sorting | ❌ | ✅ |
| Collaborative editing | ❌ | ✅ |
| Gamification | ❌ | ✅ |
| Location based reminders | ❌ | ✅ |
Plus a paragraph of text!
Expected behavior
You see the translation, ideally WITH markdown. I realize that selecting an entire document with images and their description, tables, warning boxes, check boxes and so on, and getting it translated - that's a step beyond where we are... So I think we should find out how to fail more gracefully 😄
Screenshots
If applicable, add screenshots to help explain your problem.
Server details:
- Nextcloud version: e.g. 27.1.0 RC1
on tech-preview
Client details:
- Browser: Firefox, Linux and Firefox/MacOS
I have a juicy JS console log below.
Logs
Nextcloud log (data/nextcloud.log)
Insert your Nextcloud log here
Browser log
{
"message": "Request failed with status code 400",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 400\n at https://tech-preview.nextcloud.com/apps/text/js/text-viewer.js?v=e2b26a83-6149:2:3012758\n at XMLHttpRequest.u (https://tech-preview.nextcloud.com/apps/text/js/text-viewer.js?v=e2b26a83-6149:2:3012903)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"requesttoken": "qXa9MxM7RA7wIyedKwkznhrZHMeWmDXzsfO35GGu2xw=:zCeLdXgJLl2FF0OyYDx71WqoM5H67nSHh7v2iAf7jC0="
},
"method": "post",
"url": "https://tech-preview.nextcloud.com/ocs/v2.php/translation/translate",
"data": "{\"text\":\"Introducing Our Revolutionary App to Help You Manage Your Daily Life Feeling like you're drowning in a sea of tasks and responsibilities? Tired of the daily grind sapping your energy and leaving you feeling defeated? Well, it's time to turn the tide with our incredible new app that's all about making your life easier, more organized, and heck, even more fun! Imagine this app as your trusty sidekick, there to help you conquer your day like a superhero. Whether you're wrangling work projects, balancing family commitments, or navigating the maze of student life, our app is like that wise friend who's got your back. Quick table overview: Feature Other apps Our app AI based task sorting ❌ ✅ Collaborative editing ❌ ✅ Gamification ❌ ✅ Location based reminders ❌ ✅ Now, let's talk style. Our app isn't just a behind-the-scenes wizard; it's a fashion statement. Sleek, modern, and oh-so-pretty, it'll give your phone screen a makeover while keeping your life on track. Check your schedule, set those nifty reminders, and access what you need with a swipe – it's like a digital magic wand. \",\"fromLanguage\":null,\"toLanguage\":\"es\"}"
},
"code": "ERR_BAD_REQUEST",
"status": 400
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the translation request in text-viewer.js and the /ocs/v2.php/translation/translate endpoint, then reproduce the failure with multiple paragraphs, tables, and task-list markup. Check how the 400 response is handled and compare it with the expected translated content. Done means the feature either handles this selection gracefully or returns the translated content with markdown where supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, markdown
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100