https://github.com/lyh990517/android-notion-string-plugin
π Gradle plugin that generates Android string resources from Notion database with 35+ languages support
https://github.com/lyh990517/android-notion-string-plugin
android automation gradle gradle-plugin kotlin localization multi-language notion notion-api notion-database string-resources
Last synced: 2 months ago
JSON representation
π Gradle plugin that generates Android string resources from Notion database with 35+ languages support
- Host: GitHub
- URL: https://github.com/lyh990517/android-notion-string-plugin
- Owner: lyh990517
- License: mit
- Created: 2025-08-04T05:09:54.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-09-15T02:46:58.000Z (3 months ago)
- Last Synced: 2025-09-15T04:29:48.018Z (3 months ago)
- Topics: android, automation, gradle, gradle-plugin, kotlin, localization, multi-language, notion, notion-api, notion-database, string-resources
- Language: Kotlin
- Homepage:
- Size: 179 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Notion Stringboard Plugin
A powerful Gradle plugin that automatically generates Android string resources from your Notion database with advanced filtering and multi-language support.
## β¨ Features
- π **Multi-language support**: Generate string resources for 35+ languages
- π **Automated sync**: Fetch translations directly from Notion database
- π± **Android optimized**: Generates proper Android XML string resources
- ποΈ **Build integration**: Seamlessly integrates with your Gradle build process
- π― **Advanced filtering**: Use complex queries to filter your Notion data
- π **Sorting options**: Sort by properties, timestamps, and custom criteria
## π Quick Setup
### 1οΈβ£ Apply the plugin
In your `build.gradle.kts` (Module level):
```kotlin
plugins {
id("io.github.lyh990517.notion-stringboard") version "1.0.10"
}
```
### 2οΈβ£ Configure the plugin
```kotlin
stringboard {
// Required: Your Notion credentials
notionApiKey = "your_notion_integration_token"
dataSourceId = "your_notion_datasource_id"
// Required: Output directory for generated resources
outputDir = "${project.rootDir}/app/src/main/res"
// Required: Column name in Notion that contains Android string resource IDs (e.g., "resource_id_1", "project_a_home_1")
idPropertyName = "Resource ID"
// Required: Define your supported languages
languages = listOf(
Language.English("String: BASE"),
Language.Korean("String: KOR"),
Language.Japanese("String: JPN")
)
// Optional: Advanced filtering and sorting (if not specified, all data from the database will be fetched)
queryBuilder = NotionQueryBuilder()
.filter {
richText { "String: BASE" contains "hello" } and
select { "Status" equals "Published" }
}
.sort {
property { "Resource ID" by Direction.ASCENDING }
}
}
```
### 3οΈβ£ Set up Your Notion Database
Create a Notion database with these columns:
> π **Reference**: [Sample database template](https://wealthy-client-873.notion.site/25b8bc2ec9148051ac4beb6b9aaf914a?v=25b8bc2ec91480a299ff000c8da4da11&source=copy_link)
| Column Name | Type | Purpose |
|--------------|-----------|------------------------------|
| Resource ID | Title | Android string resource name |
| String: BASE | Rich Text | English/default text |
| String: KOR | Rich Text | Korean translation |
| String: JPN | Rich Text | Japanese translation |
| Status | Select | Publication status |
**Example data:**
| Resource ID | String: BASE | String: KOR | String: JPN | Status |
|-------------|--------------|-------------|-------------|---------|
| hello_world | Hello World! | μλ
νμΈμ! | γγγ«γ‘γ―οΌ | Published |
| welcome_msg | Welcome | νμν©λλ€ | γγγγ | Published |
πΈ Database Screenshot

---
## βοΈ Advanced Configuration
π Extended Language Support
The plugin supports **35+ languages**. Add any combination:
```kotlin
languages = listOf(
// Asian Languages
Language.Korean("String: KOR"),
Language.Japanese("String: JPN"),
Language.ChiSimplified("String: CHS"),
Language.ChiTraditional("String: CHT"),
Language.Thai("String: THA"),
Language.Vietnamese("String: VIE"),
// European Languages
Language.English("String: BASE"),
Language.Spanish("String: SPA"),
Language.French("String: FRA"),
Language.German("String: DEU"),
Language.Italian("String: ITA"),
Language.Portuguese("String: POR"),
Language.Dutch("String: NLD"),
Language.Russian("String: RUS"),
// And many more...
)
```
π― Advanced Filtering & Sorting
Use the powerful query builder to filter your data:
```kotlin
queryBuilder = NotionQueryBuilder()
.filter {
// Text filters
richText { "String: BASE" contains "welcome" } and
richText { "String: KOR".isNotEmpty } and
// Select/Multi-select filters
select { "Status" equals "Published" } and
multiSelect { "Tags" contains "Mobile" } and
// Boolean filters
checkBox { "Deprecated" equals false } or
// Combine with OR
(select { "Priority" equals "High" } or
select { "Priority" equals "Medium" })
}
.sort {
// Sort by properties
property { "Resource ID" by Direction.ASCENDING }
property { "Priority" by Direction.DESCENDING }
// Sort by timestamps
timestamp { Timestamp.CREATED_TIME by Direction.DESCENDING }
timestamp { Timestamp.LAST_EDITED_TIME by Direction.ASCENDING }
}
```
---
## π Getting Notion Credentials
### Create Integration & Get Credentials
1. Go to [π Notion Integrations](https://www.notion.so/my-integrations)
2. Click **"New integration"**, name it and select your workspace
3. Copy the **"Internal Integration Token"**
4. Open your Notion database and copy the datasource ID:
πΈ See screenshot

### Secure Storage
Add to your `local.properties`:
```properties
NOTION_API_KEY=your_integration_token_here
DATA_SOURCE_ID=your_database_id_here
```
Then use in `build.gradle.kts`:
```kotlin
val localProperties = Properties().apply {
load(rootProject.file("local.properties").inputStream())
}
stringboard {
notionApiKey = localProperties.getProperty("NOTION_API_KEY")
dataSourceId = localProperties.getProperty("DATA_SOURCE_ID")
// ... other config
}
```
---
## π― Usage
### Generate String Resources
```bash
./gradlew fetchStringboard
```
**This generates:**
- πΊπΈ `values/strings.xml` (English)
- π°π· `values-ko/strings.xml` (Korean)
- π―π΅ `values-ja/strings.xml` (Japanese)
- π And all other configured languages...
---
## π Supported Languages
View all 35+ supported languages
| Region | Languages |
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **π Asian** | Korean (ko), Japanese (ja), Chinese Simplified (zh-rCN), Chinese Traditional (zh-rTW), Thai (th), Vietnamese (vi), Hindi (hi), Indonesian (id), Malay (ms), Filipino (fil) |
| **π European** | English (default), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Dutch (nl), Russian (ru), Polish (pl), Czech (cs), Hungarian (hu), Romanian (ro), Croatian (hr), Serbian (sr), Bulgarian (bg), Greek (el), Swedish (sv), Norwegian (no), Danish (da), Finnish (fi), Ukrainian (uk) |
| **π Others** | Arabic (ar), Hebrew (iw), Turkish (tr), Persian (fa), Swahili (sw), Bengali (bn), Tamil (ta), Telugu (te), Gujarati (gu), Marathi (mr), Punjabi (pa), Urdu (ur) |
---
## π Requirements
- β
Android Gradle Plugin 7.0+
- β
Gradle 7.0+
- β
Java/Kotlin 17+
- β
Active Notion workspace and database
---
## π€ Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
---
## π License
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
---
## βΉοΈ Information
- **Notion API version**: `2025-09-03`
## π Links
- π [**Gradle Plugin Portal**](https://plugins.gradle.org/plugin/io.github.lyh990517.notion-stringboard)
- π [**Notion API Documentation**](https://developers.notion.com/)
---
**Made with β€οΈ for Android developers who love automation**
β **Star this repo if it helped you!** β