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 Bokmål (Norwegian) keyboard #135

Open
4 of 11 tasks
andrewtavis opened this issue Feb 12, 2022 · 45 comments
Open
4 of 11 tasks

Add Bokmål (Norwegian) keyboard #135

andrewtavis opened this issue Feb 12, 2022 · 45 comments
Labels
-priority- High priority help wanted Extra attention is needed new keyboard Adding a new language keyboard

Comments

@andrewtavis
Copy link
Member

andrewtavis commented Feb 12, 2022

Terms

Language support

Norwegian is another language that has a lot of available data on Wikidata that further has grammar structures that Scribe could really serve. There are three genders - masculine, feminine and neutral, but verb conjugation is more similar to Danish and Swedish meaning that the 2x2 conjugation display would likely be used.

Of note is that there are two written forms of Norwegian - Bokmål and Nynorsk. This issue would focus on Bokmål as there is dramatically more support for it on Wikidata at time of writing (roughly 85% of Norwegians use Bokmål), but another issue to make a Nynorsk keyboard would be welcome 😊

Contribution

I'd be happy to work on this, and it may be focussed on in a future release :)

What's needed

  • A Bokmål directory added to Keyboards/LanguageKeyboards that includes a BokmålKeyboardViewController.swift file
  • Bokmål language keyboard values and logic added to NBInterfaceVariables.swift in the above directory
  • Bokmål language keyboard commands added to NBCommandVariables.swift in the above directory
  • Fine tuning the WDQS queries found in Scribe-Data/Data/Bokmål
  • Writing formatting Python scripts and adding them to Scribe-Data/Data/Bokmål
  • Add Bokmål keyboard specific logic to KeyboardViewController.swift
  • Setting up alternate key functions if there are keys that have them that aren't already implemented
  • Adding all the formatted JSON data to a Data directory in the new directory and updating the data table in the readme
@andrewtavis andrewtavis added good first issue Good for newcomers help wanted Extra attention is needed -priority- High priority new keyboard Adding a new language keyboard labels Feb 12, 2022
@andrewtavis
Copy link
Member Author

Word counts via Data/check_language_data.sparql:

type total
adjective 4269
adverb 107
article 1
noun 19748
preposition 59
pronoun 21
proper noun 872
verb 4705

@andrewtavis
Copy link
Member Author

The ISO 639-1 for Bokmål is nb, so that's what we'd be using for abbreviations.

@gkprasanth
Copy link

Can I work on this issue?

@andrewtavis
Copy link
Member Author

Hey @gkprasanth! You'd be welcome to work on this :) This would definitely be a beneficial language to add into Scribe. Do you have experience with Bokmål? It's fine if you don't so long as you understand that there will be some research for how the grammar works.

I'm currently working on another project right now, but should switch back to looking at Scribe next week. At that point I'd have more time to support. For now feel free to ask questions on the process above if you have them 😊

Thanks for reaching out!

@gkprasanth
Copy link

I don't have any idea about scribe or
Bokmål. Can you explain me what is the issue exactly and what I need to do? I would really like to contribute to this issue as there have been no responses since when the issue is opened.

@gkprasanth
Copy link

I am ready to research or learn anything if needed in order to contribute.

@andrewtavis
Copy link
Member Author

There is a lot to be done for this, and it's all detailed in the What's needed section of the issue. The first three steps are fairly straightforward - making a directory in Keyboards/LanguageKeyboards that has a similar file structure to the ones that are in there now and has files like NBInterfaceVariables.swift and NBCommandVariables.swift. The contents of the files would be similar to those that you can see for other languages. I would likely need to create the directory for you as that's adding an embedded keyboard app to Scribe, but then you could copy some of the information from other languages over and we could research how the information needs to change.

I could add that new app for you in the next few days if that sounds good. Aside from that, the question is how much Swift or Python you know. Would be happy to give you some pointers on either, but Swift is what the keyboard app is written in, and Python is how the data we get from Wikidata is manipulated. I can also send along some resources for learning those languages if you'd like to practice a bit and we can be in touch from there!

@gkprasanth
Copy link

Thank you so much, @andrewtavis, for your kindness. I am familiar with Python's syntax, but I am not familiar with Swift. If you could provide me with the resources as you said, it would be really helpful. As I've already stated, I'm willing to learn anything to be able to contribute.

@andrewtavis
Copy link
Member Author

Sounds great, @gkprasanth! The data process for this should be able to help you learn some more Python, but first I need to get it to that point. I need to catch up with some other issues, but I'll write to you here next week 😊

@gkprasanth
Copy link

Okay done. Till then do you want me to learn on work on something? Or should I just clone the project and look at the source code?

@andrewtavis
Copy link
Member Author

I'd say cloning the project and checking out the source code would be enough for now. Specifically the Python work is actually done in Scribe-Data. You can check the Bokmål directory there to see the examples of the words we'd be getting out. In each of the directories we'd need to write Python scripts to format the data extracted from Wikidata appropriately, with there being tons of examples for the other languages that Scribe supports :)

@andrewtavis
Copy link
Member Author

Let me know if you have any questions or would like some learning resources!

@gkprasanth
Copy link

gkprasanth commented Jan 26, 2023

I have seen the python files inside scribe-data and honestly I am not able to understand any of the code written there since this is my first time looking into a project. It's too intimidating looking at code more than a 100 lines.

@andrewtavis
Copy link
Member Author

I'd say that the tutorial for Python would be a good place to start so that you have a good idea of what the code is saying. If you check that out then we can have better discussions about what's happening in the code, and I'd be happy to explain some of the parts to you :)

@gkprasanth
Copy link

I'd say that the tutorial for Python would be a good place to start so that you have a good idea of what the code is saying. If you check that out then we can have better discussions about what's happening in the code, and I'd be happy to explain some of the parts to you :)

Thanks for sharing this I will start working Python and then look into this project so that I can get better understanding of what exactly is this about.

@andrewtavis
Copy link
Member Author

Good luck!

You can also check the video of the app on the readme. Basically what Scribe is is keyboards that help second language learners when they forget grammar points. So some languages have masculine, feminine or neutral nouns that you need to remember their genders, or there's also verbs that need to be conjugated that are hard to remember, but with Scribe it's all in the keyboard. The goal is to continue to improve the current app so that people don't need to leave their keyboard to use the web or another app to check for things they're forgetting in a language they're learning. With that also comes data privacy as well, as the team has no interest in collecting user data :)

The Python scripts you see are formatting data that we get from Wikidata, which is a giant database from the Wikimedia Foundation that also makes Wikipedia. We get semi structured data from Wikidata, and then use Python to prepare it for the app. It's an iOS app, so it's written in Swift, but we also are slowly working on an Android version in Kotlin.

Hope that makes some sense!

@gkprasanth
Copy link

Good luck!

You can also check the video of the app on the readme. Basically what Scribe is is keyboards that help second language learners when they forget grammar points. So some languages have masculine, feminine or neutral nouns that you need to remember their genders, or there's also verbs that need to be conjugated that are hard to remember, but with Scribe it's all in the keyboard. The goal is to continue to improve the current app so that people don't need to leave their keyboard to use the web or another app to check for things they're forgetting in a language they're learning. With that also comes data privacy as well, as the team has no interest in collecting user data :)

The Python scripts you see are formatting data that we get from Wikidata, which is a giant database from the Wikimedia Foundation that also makes Wikipedia. We get semi structured data from Wikidata, and then use Python to prepare it for the app. It's an iOS app, so it's written in Swift, but we also are slowly working on an Android version in Kotlin.

Hope that makes some sense!

Thanks for the information it was necessary for me before looking into the code😊

@andrewtavis
Copy link
Member Author

Very welcome, @gkprasanth! Happy to explain and support as I can 🙂

@gkprasanth
Copy link

@andrewtavis I have created Bokmål and added BokmålKeyboardViewController.swift file which contains class BokmålKeyboardViewController: KeyboardViewController {} same as other languages folder. Do I need to change anything or what I have done is correct?

@gkprasanth
Copy link

gkprasanth commented Jan 28, 2023

should I create BKCommandVariables.swift and BKInterfaceVariables.swift files along with directory names data and info.plist?
I have no idea about what is written inside I am just following same as what is written in other language's directories.

@andrewtavis
Copy link
Member Author

Hi @gkprasanth :) I'll make the directory with the info.plist next week, and then you can add BokmålKeyboardViewController.swift along with BKInterfaceVariables.swift and BKCommandVariables.swift :) What it is that you've done for BokmålKeyboardViewController.swift is so far correct 😊

Just wondering, are you an iOS or an Android user?

Thanks for the efforts so far!

@gkprasanth
Copy link

I am an android user👽

@gkprasanth
Copy link

gkprasanth commented Jan 28, 2023

Simply put, I have no idea how I ended up looking into an iOS open source project. I'll look at the swift code of other languages' InterfaceVariables and CommandVariables files and try to understand the code until you create those directories .

@andrewtavis
Copy link
Member Author

You could also look into Scribe-Android a bit if you'd like? We're working on releasing the keyboard for Android over there, and you'd be able to work on something that you could one day test/use :) Up to you, but I find it much easier to work on things that I can one day play around with 😊

@andrewtavis
Copy link
Member Author

The repo for that is here. I'd suggest you look into the Kotlin docs a bit before you start, but that language is how Android is going to be developed for the next 5+ years, and has tons of more applications :) Would be a great time investment for you, and the issues there are a bit more lower level as it's earlier stage :)

@gkprasanth
Copy link

You could also look into Scribe-Android a bit if you'd like? We're working on releasing the keyboard for Android over there, and you'd be able to work on something that you could one day test/use :) Up to you, but I find it much easier to work on things that I can one day play around with 😊

Yeah I would love to..

@andrewtavis
Copy link
Member Author

You can definitely do commits to both, but I'd definitely pick one to focus on :) If you want to make apps for yourself some day, then sounds like Android would be the way to go 😊 Have you taken a look at the Kotlin docs? I did them a few months ago and found them very helpful.

@gkprasanth
Copy link

You can definitely do commits to both, but I'd definitely pick one to focus on :) If you want to make apps for yourself some day, then sounds like Android would be the way to go 😊 Have you taken a look at the Kotlin docs? I did them a few months ago and found them very helpful.

Yes

@gkprasanth
Copy link

Actually I am into web development so for that I have to learn javascript so right now it's like I have learn many things at once.

@andrewtavis
Copy link
Member Author

I totally understand learning too many things at once 😅 I'll make the directory for you next week so that you can make those commits, and we can see where it goes from there. As far as looking into new languages, as you are an Android user I would definitely suggest Kotlin and to take the time to go through the docs, but happy to work with you on whatever 🙂

@gkprasanth
Copy link

I totally understand learning too many things at once 😅 I'll make the directory for you next week so that you can make those commits, and we can see where it goes from there. As far as looking into new languages, as you are an Android user I would definitely suggest Kotlin and to take the time to go through the docs, but happy to work with you on whatever 🙂

I genuinely appreciate that, thank you so much, man. I'll research Kotlin and try to contribute as much as I can to both repos.

@andrewtavis
Copy link
Member Author

It’s tough at the start! Keep at it :) Trust me coding takes these kind of tutorials from start to finish again and again. I just did one a few weeks ago 🙃 Best thing is that each one you do makes the next a bit easier :)

@gkprasanth
Copy link

gkprasanth commented Jan 29, 2023

It’s tough at the start! Keep at it :) Trust me coding takes these kind of tutorials from start to finish again and again. I just did one a few weeks ago 🙃 Best thing is that each one you do makes the next a bit easier :)

Yeah I have to give time for that and learn properly.

@andrewtavis andrewtavis removed the good first issue Good for newcomers label Mar 4, 2023
@gkprasanth
Copy link

Hi @andrewtavis any update on those folders? I gave a long break due to some personal reasons and I would again like to start working on this.

@andrewtavis
Copy link
Member Author

Hi @gkprasanth, thanks for writing again :) First and foremost, I hope that everything ok with you and am wishing you the best!

Sorry the folder has taken so long, and I really do appreciate your interest in this :) Let me work on getting that in here now 😊 It'll just be the base folder as we discussed so that you can add the files in and we can work from there :)

@gkprasanth
Copy link

Hi @gkprasanth, thanks for writing again :) First and foremost, I hope that everything ok with you and am wishing you the best!

Sorry the folder has taken so long, and I really do appreciate your interest in this :) Let me work on getting that in here now 😊 It'll just be the base folder as we discussed so that you can add the files in and we can work from there :)

Yesss😊

@andrewtavis
Copy link
Member Author

Alright, @gkprasanth! Here we go 😊

Keyboards/LanguageKeyboards/Norwegian has now been created and is ready for us to start working on :) Norwegian has also been set up as an option within the Scribe app, so as of now a person can go into their settings and select a Norsk - Scribe keyboard, which when selected will just break and revert to a system Norwegian Keyboard :) It's now our job to set it up so it all works 🚀

A first commit that can be made is that we need to add a reference to the main KeyboardViewController to LanguageKeyboards/Norwegian/NBKeyboardViewController.swift as is done in the other languages. From there we need to make NBInterfaceVariables.swift and NBCommandVariables.swift. We can probably copy the versions of these files that are within Keyboards/LanguageKeyboards/Swedish as Swedish would be the closest language that we have to Norwegian :)

A note for myself for future releases, going into the Scribe target and removing Norwegian.appex from the frameworks will disable Norwegian as a selectable keyboard option. In this way we can continue to work on Norwegian and just disable it in the versions that we send to the App Store 😊

Thanks again to your commitment to this issue! It really is commendable 👏 Looking forward to working more on all this with you :) :)

@andrewtavis
Copy link
Member Author

andrewtavis commented Mar 19, 2023

d86e465 makes a simple change to they keyboard name so that it's Norsk (Bokmål) and thus clear which version of Norwegian it is :)

@gkprasanth
Copy link

Alright, @gkprasanth! Here we go 😊

Keyboards/LanguageKeyboards/Norwegian has now been created and is ready for us to start working on :) Norwegian has also been set up as an option within the Scribe app, so as of now a person can go into their settings and select a Norsk - Scribe keyboard, which when selected will just break and revert to a system Norwegian Keyboard :) It's now our job to set it up so it all works 🚀

A first commit that can be made is that we need to add a reference to the main KeyboardViewController to LanguageKeyboards/Norwegian/NBKeyboardViewController.swift as is done in the other languages. From there we need to make NBInterfaceVariables.swift and NBCommandVariables.swift. We can probably copy the versions of these files that are within Keyboards/LanguageKeyboards/Swedish as Swedish would be the closest language that we have to Norwegian :)

A note for myself for future releases, going into the Scribe target and removing Norwegian.appex from the frameworks will disable Norwegian as a selectable keyboard option. In this way we can continue to work on Norwegian and just disable it in the versions that we send to the App Store 😊

Thanks again to your commitment to this issue! It really is commendable 👏 Looking forward to working more on all this with you :) :)

Mee too

@gkprasanth
Copy link

d86e465 makes a simple change to they keyboard name so that it's Norsk (Bokmål) and thus clear which version of Norwegian it is :)

Yup I will look into it now

@Dasika-Vaishnavi
Copy link

I am Vaishnavi Dasika. I am interested contributing to Wikimedia as a part of Google Summer of code. I wish to take up this issue and work on it. Super excited to work with the community!

@andrewtavis
Copy link
Member Author

Hi @Dasika-Vaishnavi, thanks for writing and your interest in Scribe! I would submit your application to GSoC as soon as possible. The application deadline may soon close, but a new application did just make it through (I just checked). Happy to work on this with you regardless of if you're able to apply 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-priority- High priority help wanted Extra attention is needed new keyboard Adding a new language keyboard
Projects
Status: In Progress
Development

No branches or pull requests

4 participants