-
-
Notifications
You must be signed in to change notification settings - Fork 217
Refactor Khipro combiner to load mappings from json instead of hardcoded values and update functional layout #2134
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
|
Do you think it makes sense to put the mappings into some text file? This might allow for copy/paste when updating the mappings, depending on the source file. |
|
That would make things easier for me as well. I’m open to restructuring, but I’m not sure what the process should be. Should the app load the mapping file during build, or should it be parsed manually in the code? And which format would you prefer—JSON or plain text? A brief direction would help me implement it correctly |
|
My idea was to load the file on creating the combiner (maybe just once and then keep the result in the companion object). |
|
The source mapping is an m17n Since the Because Khipro is state-based, every mapping belongs to a state, and not all states are needed on mobile. One possible approach would be to convert the {
"SHOR": { "o": "অ", "a": "আ" },
"FKAR": { "fa": "া", "fi": "ি", "fii": "ী" }
}The combiner could load this JSON once, build the internal tables, and handle state transitions exactly as defined by the source. This would make updates simple and keep the structure clear. If this direction fits the project, I can implement it in this PR. |
Ah, so just copying (part of) the file might not be suitable.
If this works for you and simplifies future updates I think it would be good. |
|
Refactor done. The combiner now loads all mappings from JSON. The JSON is generated from the Khipro source repo and will be kept updated there: https://github.com/KhiproTeam/Khipro-Mappings. The file One idea I wanted to ask about: is it possible to add that mapping repo as a git submodule so it stays synced automatically during the build? |
…, improve consistency, and fix a minor Reph-state error.
…tem implementation
…ayout for user-customizable choice; map Shift → '/' and add ';' after space to follow official Khipro touchscreen adaptation rules.
|
Thanks, this is a good solution!
What I'd prefer is adding it to release.py, which I run before each release to make sure I don't forget stuff like updating translations or adding changelogs. |
|
OK then, that will be good. The mappings will be managed by the |
|
Actually I hadn't noticed before that now there are separate functional keys for Khipro again. Why is that? |
|
Khipro recently updated its default touchscreen layout, where |
|
Ok, got it. I'm not happy about it because it somewhat interferes with existing custom layouts, but looks like there is no better solution. A few things:
|
|
Understood. Next time I’ll always try to make separate PRs for each unrelated change. The other points are addressed in the latest commits: in-app logging is used, the application context was replaced with the IME service context via Thanks for the review. |
This PR refreshes
BnKhiproCombinerto align with the newest official Khipro release, keeping the mapping behavior consistent and up to date.