How scribe-org/scribe-ios works
Based on our analysis of the file tree and README, Scribe-iOS is a Swift/iOS application that provides language learning keyboards. Its purpose is to supply a keyboard extension that offers language tools such as translation (β), verb conjugation, noun pluralization, and word annotation. The project is structured as follows:
Main application and keyboard extension
• The “Keyboards” directory is divided into a “KeyboardsBase” (for common keyboard interfaces, styling, utility extensions, and shared functionality) and “LanguageKeyboards” (which holds language-specific implementations for English, French, German, etc.). This clear separation lets the project use common mechanics while supporting different language variations.
Internationalization and localization
• The “Scribe/i18n” directory deals with all the internationalization aspects. It holds localized strings (in JSON and .xcstrings formats), conversion scripts (Python scripts for iOS/Android conversion), and even its own GitHub workflow for i18n processing. This shows a structured approach to supporting multiple languages and ongoing localization efforts.
Development infrastructure
• The “.github” folder contains configurations for pull requests, issue templates, code of conduct, and multiple GitHub workflows (CI, SwiftLint, test checks) ensuring code quality.
• Tools such as swiftformat, swiftlint, and a pre-commit configuration are present to enforce code style and consistency.
External integrations and data components
• The project is closely tied to Wikidata (used for sourcing feature data and translations) and integrates machine translations (via Transformers) as well as language-specific databases (e.g. via LanguageDBManager found in the KeyboardsBase section).
• References to Scribe-Data, Scribe-Android, and planned Scribe-Desktop signal an architecture that fits into a broader ecosystem of related projects (external services and multi-platform extensions).
A. Identify and lay out the main components:
• Keyboard Extension Core: Divide the “Keyboards” part into two submodules—common/shared functionality (KeyboardsBase) and language-specific implementations (LanguageKeyboards).
• Main Application UI: Illustrate the “Scribe” module where view controllers, storyboards, and UI elements (AboutTab, InstallationTab, SettingsTab) are managed.
• Internationalization Module: Represent the “Scribe/i18n” section (localizable strings, conversion scripts, resource processing).
• External/Data Services: Show the connection to external data sources (Wikidata) and the use of machine translation libraries (Transformers) along with database management (LanguageDBManager).
B. Define the relationships and data flow:
• From the keyboard UI, show flows toward language-specific modules when a user performs operations like translation, conjugation, or pluralization.
• Data flows from the language processing modules to the database component (via LanguageDBManager) and from there to the presentation logic.
• Additionally, annotate data inputs/outputs representing the sourcing of feature data from external resources (Wikidata, Transformers library).
C. Represent key architectural patterns:
• The separation of concerns (shared keyboard logic vs. language-specific variations).
• Use of Model–View–Controller (MVC) or another suitable design pattern as suggested by the presence of controllers and view models in Scribe.
• The integration of CI/CD and pre-commit hooks should be shown to underline the automated quality assurance pipeline.
D. Include relevant technologies, frameworks, and libraries:
• Swift and the Xcode environment as fundamental tools.
• Use of SwiftLint, SwiftFormat, and pre-commit as part of development automation.
• Mention integration with GRDB (for database management) and any other external libraries (SwiftyJSON, CustomKeyboard, etc.) that influence the architecture.
• Don’t forget the external dependencies like the Transformers library for translation and the Wikidata API.
• Use clear labels for each component (e.g., “Keyboard Core (KeyboardsBase)”, “Language-Specific Keyboards (Keyboards/LanguageKeyboards)”, “Scribe Main UI”, “Internationalization Module”, “Assets & Resources”, “CI/CD & DevOps”).