yorkie-team / codepair

Build your own AI-powered collaborative markdown editor in just 5 minutes
https://codepair.yorkie.dev
Apache License 2.0
46 stars 19 forks source link

Unable to Access Workspace when Creating a Workspace with non-English Language #209

Closed devleejb closed 1 month ago

devleejb commented 2 months ago

What happened: When creating a Workspace using a non-English language, specifically when using characters outside the English alphabet, the user is unable to access the Workspace. The slug creation process seems to be encountering issues when handling non-English characters.

What you expected to happen: I expected to be able to create a Workspace using a non-English language and access it without any issues.

How to reproduce it (as minimally and precisely as possible):

  1. Create a new Workspace.
  2. Use non-English characters (such as Korean, Chinese, etc.) during the Workspace creation process.
  3. Try to access the created Workspace.

Anything else we need to know?: It is important to ensure that the slug creation process can handle non-English characters to allow users to create Workspaces in different languages.

Environment:

minai621 commented 1 month ago

This issue seems to be related to #234 . Can I try this issue?

devleejb commented 1 month ago

@minai621 Sure! It would be good to leave comments on the plan before implementation.

minai621 commented 1 month ago

@devleejb The root cause of the issue is that a blank string is returned because slugify does not support Korean. slugify has no attempt to support Koren in locale. locales.json Therefore, the solution is to use a library that romanizes multilingualism. Among the libraries that support es6, chose transliteration, a library that seamlessly supports multilingualism.

minai621 commented 1 month ago

@devleejb I tried using transliteration. but, it can't support to all languages. And we have to consider all the texts as well as the language. For example, an emoji is ignored in the process of slug conversion in transliteration. How about using Unicode, or Hash? However, the currently created workspace needs to be converted into Unicode and Hash.

injae-kim commented 1 month ago

we have to consider all the texts as well as the language. How about using Unicode, or Hash?

+1, encoding + hash url slug is widely used like above 👍

devleejb commented 1 month ago

@injae-kim Thank you for your suggestion!

I'd like to introduce only encoding because of consistency. The introduction of Slug in CodePair was intended to quickly identify Workspaces through clean URLs (Like GitHub URL). Therefore, how about maintaining this by allowing non-English languages to be accessed through encoding, even though they may not be as clean?

minai621 commented 1 month ago

@devleejb Returns an empty string if user has entered only an emoji. (ex: 😀😀😀 or unsupported languages..) If using slug, the input must be in English or contain at least two English characters.

devleejb commented 1 month ago

@minai621 I think only at least two letters is okay. We can encode letters except English. Is it right?

minai621 commented 1 month ago

@devleejb

@minai621 I think only at least two letters is okay. We can encode letters except English. Is it right?

That's right. I think that's best to do it, so I made a this pull request. #261