A powerful Gradle plugin that automatically generates Android string resources from your Notion database with advanced filtering and multi-language support.
- π 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
In your build.gradle.kts
(Module level):
plugins {
id("io.github.lyh990517.notion-stringboard") version "1.0.2"
}
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 }
}
}
Create a Notion database with these columns:
π Reference: Sample database template
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 |
π Extended Language Support
The plugin supports 35+ languages. Add any combination:
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:
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 }
}
- Go to π Notion Integrations
- Click "New integration", name it and select your workspace
- Copy the "Internal Integration Token"
- Open your Notion database and copy the datasource ID:
Add to your local.properties
:
NOTION_API_KEY=your_integration_token_here
DATA_SOURCE_ID=your_database_id_here
Then use in build.gradle.kts
:
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
}
./gradlew fetchStringboard
This generates:
- πΊπΈ
values/strings.xml
(English) - π°π·
values-ko/strings.xml
(Korean) - π―π΅
values-ja/strings.xml
(Japanese) - π And all other configured 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) |
- β Android Gradle Plugin 7.0+
- β Gradle 7.0+
- β Java/Kotlin 17+
- β Active Notion workspace and database
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Notion API version:
2025-09-03
- π Gradle Plugin Portal
- π Notion API Documentation
Made with β€οΈ for Android developers who love automation
β Star this repo if it helped you! β