HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
11.82k stars 4.05k forks source link

punctuation in wrong place in RTL text (Arabic, maybe others) #11364

Closed Alys closed 3 years ago

Alys commented 5 years ago

@sora-01 (30647f40-eeb7-4d3a-a52a-40491b3eab84) reports:

"Hi! I'm from the Pirate Cove. When I posted Arabic messages in a chat, I noticed periods at the end of a paragraph were displayed on the right like English. It's not the correct position, because periods are usually on the left in Arabic. The same problem happened to exclamation marks. This display problem happens on website and I'm using Google Chrome. I don't really understand Arabic. I found this problem by chance, so I'm letting you know just to be sure. Thanks!"

(sora-01 was pasting Arabic text written by an Arabic speaker for the Pirate Cove guild (a guild that helps other guilds find new leaders and become more active).)

@citrusella added:

"The guild @sora-01 posted to appears to be Arab Folks. It seems all LTR text posted in a message done in RTL text could end up in a wrong place syntactually, and periods and exclamations are being treated as LTR text, I guess? (Question marks appear to be a different glyph in Arabic and thus unaffected.) I tried playing around with copying some text from Arabic Wikipedia's Main Page's talk page to my party and Habitica treated the strings fairly differently where LTR characters of any kind were involved."

@sora-01 said:

"I posted those messages in my private guild and Arab Folks as @citrusella says. To avoid confusion, I deleted periods at the end of a paragraph in the Arabic Hail for posting Arab Folks. I also modified Hails In Other Languages. I tried to recreate the message in my private guild just now: https://snipboard.io/hB8jtd.jpg https://snipboard.io/3RN6DW.jpg [images copied below]

"I found a conversation like this in Arabic Language Learners (one year ago): 'I did set up the Windows Arabic keyboard on my computer, but at least on Habitica it messes up the punctuation. I'm hoping that it's just Habitica that does that.' 'Yeah that's a common problem I run into all the time. tbh it doesn't get better and it's always frustrating'"

hB8jtd 3RN6DW

Alys commented 5 years ago

I've posted to both those guilds to ask if anyone has any more information or suggestions.

mario130 commented 3 years ago

@Alys I think I can solve this issue, I've made an Arabic site before and have some experience using Vue, but I'm new to contributing and I need help locating the file first, thanks.

mario130 commented 3 years ago

But it has to do with text aligning and input direction so I think it will be a little complex to check for change direction at every input

Alys commented 3 years ago

@mario130 Thank you! I"m marking this as in progress for you.

I'm not certain myself where this should be fixed, but if you do the Unix command below it will show you all *.vue files that have chat (case-insensitive) in their names, so one of those may be either the correct place to modify or will give you pointers to other related files (e.g., files that contain its name).

find . -type f -iname \*chat\*vue

But post again here if you need more help finding the right place to start, or if you run into any other trouble or have any questions! See Guidance for Blacksmiths and the wiki pages it links to if you haven't already found them.

mario130 commented 3 years ago

I followed all the steps in the setup guide and everything was fine with no errors until I entered npm run mongo:dev which caused the error in the image. error I didn't use MongoDB before so I don't know how to fix it or if there's already a fix.

paglias commented 3 years ago

@mario130 looks like there was some issues with the screenshot you posted, can you try again?

mario130 commented 3 years ago

@paglias that's the output

> habitica@4.161.4 mongo:dev /home/mario/Desktop/habitica
> run-rs -v 4.2.8 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet

Skipping purge
Running '/home/mario/Desktop/habitica/node_modules/run-rs/4.2.8/mongod' [ 27017 ]
Restarting replica set...
undefined
paglias commented 3 years ago

@mario130 can you try to delete the mongodb-data folder and try again?

mario130 commented 3 years ago

still the same error

paglias commented 3 years ago

Looks like there might be an issue with run-rs@0.7.0, let's try with the previous version: npm i run-rs@0.6.2

paglias commented 3 years ago

@mario130 I've downgrade run-rs to 0.6.2 which is working (https://github.com/HabitRPG/habitica/commit/1d8880c04d8bdbcccdb92361e76c683907103cfa)

You'll have to re-install it with npm i run-rs@0.6.2

mario130 commented 3 years ago

@paglias that worked thanks, will see what I can do from here

mario130 commented 3 years ago

@paglias
It's done! image I've made a pull request #12655 btw that was my first contribution to open source ^^

paglias commented 3 years ago

thanks @mario130 , I'll review it in the next few days