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

Refactor to separate out language-specific logic #323

Open
2 tasks done
wkyoshida opened this issue May 31, 2023 · 1 comment
Open
2 tasks done

Refactor to separate out language-specific logic #323

wkyoshida opened this issue May 31, 2023 · 1 comment
Labels
help wanted Extra attention is needed refactor Refactor code to improve quality

Comments

@wkyoshida
Copy link
Member

Terms

Issue

What?
This issue is for a refactor to separate language-specific logic out from the main base keyboard functionality, generally those under Keyboards/KeyboardsBase/*.swift.

Why?
Keeping the codebase cleaner and organized as code may get messy/hard-to-read with language-specific logic sprinkled around, especially as more languages are added over time (and their exceptions and quirks along with them).

How?
The general initial idea is to move language-specific logic/checks into the languages' respective Keyboards/LanguageKeyboards/{language}/*.swift files. Discussion on how to implement this exactly can be done in this issue. Work can (and likely will) happen in multiple PR increments as we identify ways on how to refactor.


Other Notes:

@wkyoshida
Copy link
Member Author

An initial idea brought up offline by @SaurabhJamadagni

Use delegate design pattern

  • Larger functions need to be broken down so that language specific parts can be delegated
  • Example case: protocol for German and Russian prepositional case annotation

@andrewtavis andrewtavis added refactor Refactor code to improve quality help wanted Extra attention is needed labels Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed refactor Refactor code to improve quality
Projects
None yet
Development

No branches or pull requests

2 participants