Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 한글 문자를 쿼티 자판에 맞는 영문 알파벳으로 변환하는 함수를 새로 추가합니다. #324

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

gunhoflash
Copy link
Contributor

Overview

한글 문자를 쿼티 자판에 맞는 영문 알파벳으로 변환하는 함수를 새로 추가합니다.

한글 입력이 포함되는 폼이나 서비스에서 영문만 입력 가능한 인풋이 있을 때(예: 여권 상 영문명 등), 한글 입력을 막거나 한/영 키를 안내하는 대신에 바로 영문자를 입력해줄 수 있습니다.

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

Copy link

changeset-bot bot commented Jan 27, 2025

🦋 Changeset detected

Latest commit: b135691

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-hangul ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 3:03am

@okinawaa
Copy link
Member

okinawaa commented Feb 6, 2025

작업해주셔서 감사해요.
영어로 한국어를 입력해버리는 실수를 탐지하기 위해서는 convertQwertyToHangul 가 꽤나 사용이 될 것 같은데요.
한글을 무의미한 영어로 변환하는 경우는 어떤 경우에 있을지 궁금합니다!

@gunhoflash
Copy link
Contributor Author

gunhoflash commented Feb 9, 2025

@okinawaa

PR 본문에서의 예시처럼, 한글과 영어 입력이 혼재하는 폼에서의 유저 경험을 높이는데 도움을 줄 수 있습니다.
특히 모바일이 아니라 PC환경에서 그렇습니다.


저는 실제로 영문명 입력 인풋에 이와 같은 로직을 적용했습니다.
kim geonho 를 입력하고자 했으나, ㅏㅑㅡ ㅎ대ㅜㅙ가 입력되는 경우, 유저는 이를 지우고 다시 한/영 키를 누른 후 다시 입력해야 하는데, 위 유틸을 활용하면 바로 kim geonho 가 입력될 것이에요.

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔끔하게 작성해주신 것 같아서 많이 배웠어요!

Comment on lines 16 to 18
it('영문, 숫자 등 한글이 아닌 글자는 그대로 유지한다.', () => {
expect(convertHangulToQwerty('FE개발!')).toBe('FEroqkf!');
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

```typescript
convertHangulToQwerty('뮻'); // 'abc'
convertHangulToQwerty('겨노'); // 'rush'
convertHangulToQwerty('빠른 논의'); // 'Qkfms shsdml'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 적절하지 않는 유즈케이스인 것 같아서 제거하는것 어떨까요?
빠른 논의를 영어(Qkfms shsdml)로 변환해야하는 경우는 잘 없을 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

설명 문서에 조금 더 의미있는 예제를 추가하고, 테스트 케이스도 수정했습니다. 28b0667

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

@okinawaa okinawaa changed the title feat: edit convertHangulToQwerty feat: 한글 문자를 쿼티 자판에 맞는 영문 알파벳으로 변환하는 함수를 새로 추가합니다. Feb 19, 2025
@okinawaa okinawaa merged commit 505b947 into toss:main Feb 19, 2025
5 of 9 checks passed
@github-actions github-actions bot mentioned this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants