https://github.com/joshspicer/widgetkit-daily-language
Learn a new language with a new word-a-day!
https://github.com/joshspicer/widgetkit-daily-language
flags french geoguessr ios-14 italian japanese language morse-code swiftui widget widgetkit
Last synced: 3 months ago
JSON representation
Learn a new language with a new word-a-day!
- Host: GitHub
- URL: https://github.com/joshspicer/widgetkit-daily-language
- Owner: joshspicer
- Created: 2020-10-10T15:14:11.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T21:55:40.000Z (about 2 years ago)
- Last Synced: 2025-06-27T23:13:10.090Z (3 months ago)
- Topics: flags, french, geoguessr, ios-14, italian, japanese, language, morse-code, swiftui, widget, widgetkit
- Language: Swift
- Homepage: https://apps.apple.com/us/app/daily-word-language-widget/id1535573526
- Size: 612 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# widgetkit-daily-language
> Download for iOS/iPad OS/MacOS here: https://apps.apple.com/us/app/daily-word-language-widget/id1535573526
This simple SwiftUI project utilizes iOS 14's WidgetKit to display a simple, at-a-glance widget with a randomly selected `{{Foreign Word}} <-> {{Native Word}}` pair.
Learn a new language with a new word a day from a language you'd like to learn.
Current Languages include:
* `Italian <-> English`
* `French <-> English`
* `Japanese <-> English`As well as some 'non-language' language sets:
* `Morse Code <-> English`
* `National Flag <-> Country Name`...with wordlists [extracted](https://github.com/joshspicer/widgetkit-daily-italian/blob/main/extract.py) using a quick BeautifulSoup script from 1000mostcommonwords.com .
## Add a language
Wordlists are embedded into the widget and can be added easily.
1. Add a unique enum for your newly [Supported Language](https://github.com/joshspicer/widgetkit-daily-italian/blob/main/DailyItalianWord/SupportedLanguages.swift).
2. Create a new `.swift` file to [/Lanaguages](https://github.com/joshspicer/widgetkit-daily-italian/tree/main/DailyItalianWord/Languages) that conforms to the `LanguageBase` protocol.### Example {{language}}.swift
```swift
class {{language}} : LanguageBase {var words: [Word] = [
Word(native: "war", foreign: "guerra"),
Word(native: "thing", foreign: "cosa"),
Word(native: "street", foreign: "strada")
...
...
]
func getAll() -> [Word] {
return words
}
func getRandom() -> Word {
let number = Int.random(in: 0.. String {
return "🇮🇹"
}
}
```3. Add your new class here in the [LanguageFactory.swift](https://github.com/joshspicer/widgetkit-daily-italian/blob/main/DailyItalianWord/Languages/LanguageFactory.swift).
Your language will be available in the picker!