yyx990803 / vue-wordle

Wordle built with Vue, aka VVordle
https://vue-wordle.netlify.app/
584 stars 185 forks source link

Question. not an issue #10

Open MohammedAlrozzi opened 2 years ago

MohammedAlrozzi commented 2 years ago

Thanks for developing this. Although I have no background in coding, I managed to create an Italian version of it and it worked perfectly. This is quite easy for the latin languages. I wonder if there is a way to develop it in Arabic. I know that I have to change the list of words, and the keyboard, but it is not that straight-forward as Arabic is right-to-left language. I appreciate your advice on this.

cheers, m.

DeruytterA commented 2 years ago

I am not the original author but I just quickly looked at the code and it seems pretty easy to change it so that it works for right-to-left languages. I would suggest that you edit the function FillTile on line 55 in the Game.vue file.

There you'll see that the current row gets traversed from left to right to find the first location where there is no current letter. You could do the same thing but traverse the row from right to left. You can do this for example with an iterator variable that starts at 4 and goes down with each loop until it's at 0.

You can do the same thing for the ClearTile function at line 64. Because otherwise backspace will remove the letters in the wrong places.

I hope this helps you!