-
Notifications
You must be signed in to change notification settings - Fork 0
✨ Feat: #3 Localization을 위한 String Catalog 추가 #11
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
Conversation
zaehorang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String 타입을 써야 하는 경우를 대비해 localized 프로퍼티를 만들어 둔 점이 좋은 것 같아요!
고생 많으셨습니다! 빠르게 뷰 작업도 진행해볼게요 🐯🥲
Guryss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!!!!!! 👍
| extension StringLiterals { | ||
| enum Popup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왜 Extension으로 뺐을지 알 수 있을까요???
큰 상관은 없는데 이점이 있을까 싶어 물어봅니다 ㅎㅁㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 점점 String 값들이 많아질 것 같은데, 각각을 파일로 구분해 관리하면 가독성이 좋아질 것 같아서 뺐습니당!! 헿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 넿넿 좋아용!
About this PR
🔖 Related Issue
📚 Contents
흠.. 키 값을 한국어 그대로 사용할까 고민을 했습니다만..! 이후에 한국어 값이 변경되는 상황을 고려해 키값을 별도로 지정하고자 했습니다. "삭제할까요?"를 단순히 "삭제하시겠습니까?" 라는 문자열로 변경하는 것임에도 키를 변경하는 것은 String Catalog에서 아예 새로운 값으로 인지하더라구요. 그러면 모든 국가의 값들을 다시 입력해줘야하는 일이 발생합니다. 그래서 키를 명확하게 관리하고자 했습니다.
LocalizedStringResource에 localized 를 추가해주었습니다. SwiftUI View인 Text 등에서 직접 사용하는 경우에는 바로 인식해서 값을 쓰지만, PopupType 내부에서 String을 return 하는 경우에 오류가 나더라구요! 이를 대응하기 위해 만들어줬습니다. String 값을 직접 써야하는 경우에만-> 여기까지 쓰고 View에서 직접 LocalizedStringResource 값으로 받으면 되겠다고 판단해서 변경했습니다! 대신 혹시 모르는 상황을 대비해서 우선 localized 를 남겨두었습니다.Other information 🔥
Localization된 값을 보고 싶은 경우에,