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

Add layout of Gujarati language #417

Closed
Abcd1234-dot opened this issue Jan 14, 2024 · 16 comments
Closed

Add layout of Gujarati language #417

Abcd1234-dot opened this issue Jan 14, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@Abcd1234-dot
Copy link

There is no layout of Gujarati language in the current version. Dictionary would not be required tho. I am not sure how new layouts can be added. If it requires only translations without any technical knowledge, I can contribute.

@Abcd1234-dot Abcd1234-dot added the enhancement New feature or request label Jan 14, 2024
@Helium314
Copy link
Owner

See https://github.com/Helium314/openboard/blob/new/layouts.md for how to add layouts.
If you can provide such a layout, I can properly add it to the app, so it uses the correct language.

@Abcd1234-dot
Copy link
Author

Abcd1234-dot commented Jan 19, 2024

I have tried to create layout text file as in mentioned in the link you shared. There are too many characters to fit in layout and there's no "capital" or "small" letters in Gujarati, very similar to Hindi language, so I think we can use shift key Off for page-1, shift key On for page-2? I don't know how to use that in layout, I also checked Hindi language layout but it wasn't much help, so I tried to create two separate files for shift key On and for shift key Off. The order of characters should be consistent with any other layouts? If not, then i tried to create a layout similar to GBoard Gujarati layout. Please have a look at two txt files.
SHIFTKEY_ON(final).txt
SHIFTKEY_OFF(final).txt
For currency, "₹" is universally used symbol in India, but there used to be gujarati symbol for rupee as "૱" which you can add into currency I guess. And for numbers, this is equivalent Modern English numbers in following txt.
Numbers.txt

@Helium314
Copy link
Owner

If it's different for shift, a json layout file is necessary, see e.g. https://github.com/Helium314/openboard/blob/new/app/src/main/assets/layouts/hindi.json where a key has two entries, for shifted state and for default.
If you want to add popup keys, you can add , "popup": { "main": { "label": "*" } }, like done in https://github.com/Helium314/openboard/blob/new/app/src/main/assets/layouts/korean_sebeolsik_final.json

I can do this, but it may take a while until I find time for it.

@Abcd1234-dot
Copy link
Author

Abcd1234-dot commented Jan 20, 2024

I have created a json file as per your instructions from other two links. Please verify syntax validity. I have added rupee symbol for gujarati as one of the pop-ups, so no need to add it in currency pop-up. I already provided gujarati numbers file in previous comment.
Gujarati_layout(final).json

@Helium314
Copy link
Owner

Thanks, I'll have a look at this tomorrow.

@Abcd1234-dot
Copy link
Author

Pop-up keys on line 67 , 75, 79 are not visible for me on my android phone (android 8.1). Please verify if they are visible or not on newer android version. They are visible on linux tho.

@Helium314
Copy link
Owner

Android 8 supports Unicode 9.0, but some characters were added in 10.0.

@Helium314
Copy link
Owner

Maybe there is some other issue. On Android 9 it should work, but doesn't for me.

@Helium314
Copy link
Owner

You can try this version: openboard_1.4.5-release.zip.
Numbers are still missing.

Is anything else needed for the layout? Like a ZWNJ key, or a different symbol instead of .?

@Abcd1234-dot
Copy link
Author

Abcd1234-dot commented Jan 21, 2024

Alright, I tried apk you shared above. Almost everything works as intended, except following points ;

  1. Numbers in main number row and numpad.
    4bfd05e6-f0ae-4827-a028-1360ce5a8015
    6fbcfdb2-e45c-48c4-b9ad-a8efb2cb1b15
  2. There's no rupee symbol in (?123) menu as "₹", instead it shows "$".
    cc3c9be0-4865-4651-aa36-fd61b08f0e7f
  3. The characters which looks smaller than others (4 characters in the middle in second row) in following (first screenshot) also doesn't work as intended. The output should be similar to the second row (second screenshot) but instead of joining with previous character, they are just standalone.
    e1648499-aef8-4b4f-9139-ba086ab16913(2)
    e1648499-aef8-4b4f-9139-ba086ab16913(1)
  4. There are other small characters too in shift key ON state, but they work as intended.
    d83d4f7c-4827-4fea-a41a-dd520423fd4b

My thoughts :

  • The rupee symbol should be the default currency in this language instead of $.
  • For some characters not working properly, I can try new json file, now using latest android and Gboard rather than on LibreOffice on linux. I will provide new json file shortly.

@Abcd1234-dot
Copy link
Author

Abcd1234-dot commented Jan 21, 2024

Alright. I submit new json file with faulty characters from different source. Lets see if it works. Can you also provide me compiled apk for this?
gujarati_layout_1.json
EDIT : This following one should definitely work because I used GBoard and created it on my android 8.1, I also removed unsupported ones and made few changes as well
gujarati_layout_2.json

@Helium314
Copy link
Owner

openboard_1.4.5-release.zip with gujarati_layout_2.json
I had to revert the change in line 51, because a popup key cannot have an empty label.
The last key is the same for shift and default state. If this is correct, there is actually no need for a shift_state_selector.

@Abcd1234-dot
Copy link
Author

Abcd1234-dot commented Jan 21, 2024

Yeah, that was by mistake left blank. Everything looks great and works as intended. Just one small problem. Few characters still looks smaller than others in keyboard layout but works normal as others (as intended). Any idea why is it like this? or how to fix this?
Screenshot
Also one another request, can you change label of key (?123) to (?૧૨૩) (similarly as have done in hindi?)
Following is final edited json file. Now only issue left, is those smaller characters i mentioned.
gujarati_layout_3.json

@Helium314
Copy link
Owner

can you change label of key (?123) to (?૧૨૩)

Only this, or also for ABC key?

@Abcd1234-dot
Copy link
Author

Yes also for ABC use કખગ and . is punctuation mark as usual.

@Helium314
Copy link
Owner

Normally the key text is reduced in size if it's more than one character. It sometimes starts reducing text size too early. In this case, a labelFlag can be added (done).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants