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 Belarusan Cyrillic and Latin layouts #70

Merged
merged 16 commits into from
Oct 25, 2024

Conversation

Belarusan
Copy link
Contributor

Created a Belarusan Cyrillic layout

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Added Belarusan Cyrillic layout

Fixes the following issue(s)

Acknowledgement

Created a Belarusan Cyrillic layout
Added LANGUAGE_BELARUSIAN_CYRL -> getString(R.string.translation_belarusian)
Added strings for Belarusan Cyrillic layout
Added string for Belarusan Cyrillic layout
Update SimpleKeyboardIME.kt
Copy link
Member

@Aga-C Aga-C left a comment

Choose a reason for hiding this comment

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

Thanks for contributing, it's really helpful when native/advanced speakers can provide us more keyboard layouts, even if they're not familiar with Android development.

I've added a few comments, because right now the app doesn't compile, but fixes are simple ones. Also, I have two additional questions:

  1. In the original issue, you wrote that it's only Cyrillic layout for now. I'm not Belarusian speaker, but doesn't it only have Cyrillic alphabet? I mean, even if Belarusian native would like to write Latin characters, wouldn't English keyboard be enough? Just asking to make sure, whether it's really needed. For other languages with Cyrillic alphabet (like Russian or Ukrainian) we don't have a separate version.
  2. Here's how the layout looks like. Please check if it's how you wanted it to look:
    obraz

@@ -207,6 +207,7 @@ fun Context.getKeyboardLanguagesRadioItems(): ArrayList<RadioItem> {
fun Context.getKeyboardLanguageText(language: Int): String {
return when (language) {
LANGUAGE_ARABIC -> getString(R.string.translation_arabic)
LANGUAGE_BELARUSIAN_CYRL -> getString(R.string.translation_belarusian)
Copy link
Member

Choose a reason for hiding this comment

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

This string doesn't exist. You should add it in Commons in https://github.com/FossifyOrg/Commons/blob/master/commons/src/main/res/values/strings.xml. When creating a pull request in Commons, please mention that it's for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: FossifyOrg/Commons#60

Thank you for your instructions!

@@ -439,6 +439,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
private fun getKeyboardLayoutXML(): Int {
return when (baseContext.config.keyboardLanguage) {
LANGUAGE_ARABIC -> R.xml.keys_letters_arabic
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_belarusian_cyrl
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_belarusian_cyrl
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_letters_belarusian_cyrl

@Belarusan
Copy link
Contributor Author

Belarusan commented Aug 14, 2024

Thanks for contributing, it's really helpful when native/advanced speakers can provide us more keyboard layouts, even if they're not familiar with Android development.

I've added a few comments, because right now the app doesn't compile, but fixes are simple ones. Also, I have two additional questions:

  1. In the original issue, you wrote that it's only Cyrillic layout for now. I'm not Belarusian speaker, but doesn't it only have Cyrillic alphabet? I mean, even if Belarusian native would like to write Latin characters, wouldn't English keyboard be enough? Just asking to make sure, whether it's really needed. For other languages with Cyrillic alphabet (like Russian or Ukrainian) we don't have a separate version.
  2. Here's how the layout looks like. Please check if it's how you wanted it to look:
    obraz

Thank you very much!

The Belarusan language has two equivalent scripts: Cyrillic and Latin. Unlike Ukrainian and Russian, which use only Cyrillic, the Serbian language, for example, also has both scripts. Here is a bit more about Belarusan Latin: https://en.wikipedia.org/wiki/Belarusian_Latin_alphabet.

Many Belarusans use the Latin script today (I won't go into details). However, the English keyboard layout contains many symbols that can interfere with convenient writing in Belarusan Latin, and it lacks certain essential symbols, such as ŭ. In my opinion, a dedicated Latin layout would be a wonderful option for Belarusans.

————

Yes, the layout looks correct, but it would be better if it were more balanced. Is there any way to achieve what is shown in my image? (Please look at the bottom row with the letters)

upd: I tried changing the width of the Shift and Backspace keys to 14%, but I'm not sure how it looks (the image below was made in a graphics editor as an example).

image

Changed the width of the two keys
@Aga-C
Copy link
Member

Aga-C commented Aug 14, 2024

The Belarusan language has two equivalent scripts: Cyrillic and Latin. Unlike Ukrainian and Russian, which use only Cyrillic, the Serbian language, for example, also has both scripts. Here is a bit more about Belarusan Latin: https://en.wikipedia.org/wiki/Belarusian_Latin_alphabet.

Thanks for explaining! If so, it makes sense to have two separate keyboard layouts.

upd: I tried changing the width of the Shift and Backspace keys to 14%, but I'm not sure how it looks (the image below was made in a graphics editor as an example).

Now it looks like this:

image

@Belarusan
Copy link
Contributor Author

Thanks for explaining! If so, it makes sense to have two separate keyboard layouts.

I made a Latin layout file. Should I create a separate pull request or add it to the existing one?

Now it looks like this:

image

Thank you! It looks just like I imagined. Perfect.

@Aga-C
Copy link
Member

Aga-C commented Aug 14, 2024

 I made a Latin layout file. Should I create a separate pull request or add it to the existing one?

No need for a separate PR, you can add it here 🙂

Add a string for Belarusan Latin script and fixed for Cyrillic
Added two strings for Belarusan Latin script
Added a string for Belarusan Latin script and fixed for Cyrillic
@Belarusan Belarusan changed the title Add Belarusan Cyrillic layout Add Belarusan Cyrillic and Latins layouts Aug 14, 2024
@Belarusan Belarusan changed the title Add Belarusan Cyrillic and Latins layouts Add Belarusan Cyrillic and Latin layouts Aug 14, 2024
@Belarusan
Copy link
Contributor Author

I made a Latin layout file. Should I create a separate pull request or add it to the existing one?

No need for a separate PR, you can add it here 🙂

Thank you for the answer! It's done. I hope I did everything right 😬

@tenextractor
Copy link

@Belarusan For the Latin layout, wouldn't adding dedicated keys for the letters Ć Č Ł Ń Ś Š Ŭ Ź Ž be better? I have made a layout with dedicated keys in my keyboard.

@Belarusan
Copy link
Contributor Author

@Belarusan For the Latin layout, wouldn't adding dedicated keys for the letters Ć Č Ł Ń Ś Š Ŭ Ź Ž be better? I have made a layout with dedicated keys in my keyboard.

Thank you for sharing. I didn't want to create anything new, so I focused on existing options. I added the symbols Ć, Č, Ł, Ń, Ś, Š, Ŭ, Ź, Ž, etc., to the popup. By the way, this approach is also used in Polish.

@tenextractor
Copy link

tenextractor commented Aug 17, 2024

It does not need to be new, the letters can just be added above the existing layout. So something like this:

Ć Č Ź Ž Ń Ŭ Ś Š Ł ?
Q W E R T Y U I O P
A S D F G H J K L
⬆ Z X C V B N M ⌫

@Belarusan
Copy link
Contributor Author

It does not need to be new, the letters can just be added above the existing layout. So something like this:

Ć Č Ź Ž Ń Ŭ Ś Š Ł ?
Q W E R T Y U I O P
A S D F G H J K L
⬆ Z X C V B N M ⌫

Thank you, I understand your point.

However, layouts are not just a random set of letters; they need to be systematic. For instance, the currently popular Cyrillic Belarusan layout „йцукен“ isn't actually a systematic one — it's simply a modified version of the Russian layout. That being said, I didn't want to take it upon myself to create something entirely new. This task should involve linguists, designers, and the wider community, not just me.

@naveensingh
Copy link
Member

I tried to learn this language but I failed, miserably. I hope this works alright ;)

@naveensingh naveensingh merged commit 67f18d5 into FossifyOrg:main Oct 25, 2024
3 of 4 checks passed
@Belarusan
Copy link
Contributor Author

I tried to learn this language but I failed, miserably. I hope this works alright ;)

Thank you for your support! I'm happy to say that the layout works well. However, I noticed a problem with the Cyrillic layout popups due to my oversight. I’ve fixed it and submitted a Pull Request. I also made a small change to the Latin layout.

It's quite an impressive challenge to learn Belarusan! Unfortunately, there are not many good resources available for learning Belarusan as a foreign language. I hope that in the future, if you still have the desire to learn, better materials will become available.

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.

Add Belarusan layout
4 participants