Generate localization files for mobile applications (Android, iOS, Flutter) from Google Sheets.
__ ___
/ /__ _______ _/ (_)__ ___ ___ ____ ___
/ / _ \/ __/ _ `/ / /_ // -_) _ `/ -_) _ \
/_/\___/\__/\_,_/_/_//__/\__/\_, /\__/_//_/
/___/
--> START
# Platform: ios
# Language: en
# Generate: localization
> Create ./App/Locallization/Translate.swift -> Success
> Create ./App/Locallization/en.lproj/Localizable.strings -> Success
<-- DONE
- π Multi-Platform Support - Generate localization files for Android, iOS, and Flutter
- π Google Sheets Integration - Manage translations in a familiar spreadsheet interface
- π Multiple Languages - Support for unlimited languages and locales
- π Automatic Generation - Generate all language files with a single command
- π οΈ Customizable Output - Configure target paths and filenames
- β‘ Fast and Efficient - Quick generation with minimal configuration
brew update
brew tap prongbang/homebrew-formulae
brew install localizegen
go install github.com/prongbang/localizegen
Download the latest binary for your platform:
Create a Google Sheet with your translations:
Structure your sheet with:
- Column A: Keys (identifiers)
- Column B+: Translations for each language
From your Google Sheet URL, extract the DocumentId
and SheetId
:
https://docs.google.com/spreadsheets/d/<DocumentId>/edit#gid=<SheetId>
Example:
https://docs.google.com/spreadsheets/d/1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU/edit#gid=0
DocumentId
:1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU
SheetId
:0
Choose your platform and run the appropriate command:
Generate all languages:
localizegen -platform android \
-target ./app/src/main/res \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
Generate specific language:
localizegen -platform android \
-target ./app/src/main/res \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
Generate all languages:
localizegen -platform ios \
-target ./ProjectName/Localization \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
Generate specific language:
localizegen -platform ios \
-target ./ProjectName/Localization \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
Generate all languages:
localizegen -platform flutter \
-target ./lib/l10n \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
Flag | Description | Required |
---|---|---|
-platform |
Target platform (android , ios , flutter ) |
β |
-document |
Google Sheet document ID | β |
-sheet |
Google Sheet tab ID | β |
-target |
Output directory path | β |
-locale |
Specific language code (e.g., en , th ) |
β |
-filename |
Custom output filename | β |
android/
βββ values/
β βββ strings.xml
βββ values-de/
β βββ strings.xml
βββ values-es/
β βββ strings.xml
βββ ...
ios/
βββ Localizables.swift
βββ de.lproj/
β βββ Localizable.strings
βββ en.lproj/
β βββ Localizable.strings
βββ ...
flutter/
βββ keys_localizations.dart
βββ sources_localizations.dart
# Navigate to your Android project
cd MyAndroidApp
# Generate all localizations
localizegen -platform android \
-target ./app/src/main/res \
-document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU \
-sheet 0
# Generate iOS localizations with custom path
localizegen -platform ios \
-target ./MyApp/Resources/Localizations \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
# Generate only English for Flutter
localizegen -platform flutter \
-target ./lib/l10n \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
- Permission Denied: Make sure your Google Sheet is publicly accessible
- Invalid Sheet ID: Double-check the extracted DocumentId and SheetId
- Missing Dependencies: Ensure Go is properly installed for source installation
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this tool helpful, please consider buying me a coffee: