https://github.com/prongbang/localizegen
Generate Localization tools for Mobile Application an Android, iOS, Flutter
https://github.com/prongbang/localizegen
android-localization ios-localization localization localization-tool mobile-localization mobile-localization-tools sheet-localization
Last synced: 15 days ago
JSON representation
Generate Localization tools for Mobile Application an Android, iOS, Flutter
- Host: GitHub
- URL: https://github.com/prongbang/localizegen
- Owner: prongbang
- License: mit
- Created: 2021-09-02T15:36:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-13T04:56:28.000Z (over 2 years ago)
- Last Synced: 2025-03-07T20:18:48.881Z (about 1 year ago)
- Topics: android-localization, ios-localization, localization, localization-tool, mobile-localization, mobile-localization-tools, sheet-localization
- Language: Go
- Homepage:
- Size: 46.5 MB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# localizegen 🌍
> Generate localization files for mobile applications (Android, iOS, Flutter) from Google Sheets.
[](https://brew.sh)
[](https://github.com/prongbang/localizegen)
[](https://opensource.org/licenses/MIT)
[](https://golang.org)
```
__ ___
/ /__ _______ _/ (_)__ ___ ___ ____ ___
/ / _ \/ __/ _ `/ / /_ // -_) _ `/ -_) _ \
/_/\___/\__/\_,_/_/_//__/\__/\_, /\__/_//_/
/___/
--> START
# Platform: ios
# Language: en
# Generate: localization
> Create ./App/Locallization/Translate.swift -> Success
> Create ./App/Locallization/en.lproj/Localizable.strings -> Success
<-- DONE
```
## ✨ Features
- 🚀 **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
## 📦 Installation
### Via Homebrew (Recommended)
```shell
brew update
brew tap prongbang/homebrew-formulae
brew install localizegen
```
### Via Go
```shell
go install github.com/prongbang/localizegen
```
### Binary Downloads
Download the latest binary for your platform:
- 🍎 [macOS](https://github.com/prongbang/localizegen/blob/master/localizegen?raw=true)
- 🐧 [Linux](https://github.com/prongbang/localizegen/blob/master/binary/linux/localizegen?raw=true)
- 🪟 [Windows](https://github.com/prongbang/localizegen/blob/master/binary/windows/localizegen.exe?raw=true)
## 🚀 Quick Start
### 1. Setup Google Sheet
Create a Google Sheet with your translations:

Structure your sheet with:
- Column A: Keys (identifiers)
- Column B+: Translations for each language
### 2. Extract Sheet IDs
From your Google Sheet URL, extract the `DocumentId` and `SheetId`:
```
https://docs.google.com/spreadsheets/d//edit#gid=
```
Example:
```
https://docs.google.com/spreadsheets/d/1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU/edit#gid=0
```
- `DocumentId`: `1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU`
- `SheetId`: `0`
### 3. Generate Localization Files
Choose your platform and run the appropriate command:
#### 🤖 Android
Generate all languages:
```shell
localizegen -platform android \
-target ./app/src/main/res \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
Generate specific language:
```shell
localizegen -platform android \
-target ./app/src/main/res \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
#### 🍎 iOS
Generate all languages:
```shell
localizegen -platform ios \
-target ./ProjectName/Localization \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
Generate specific language:
```shell
localizegen -platform ios \
-target ./ProjectName/Localization \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
#### 🦋 Flutter
Generate all languages:
```shell
localizegen -platform flutter \
-target ./lib/l10n \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
## ⚙️ Command Options
| 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 | ❌ |
## 📁 Output Structure
### Android
```
android/
├── values/
│ └── strings.xml
├── values-de/
│ └── strings.xml
├── values-es/
│ └── strings.xml
└── ...
```
### iOS
```
ios/
├── Localizables.swift
├── de.lproj/
│ └── Localizable.strings
├── en.lproj/
│ └── Localizable.strings
└── ...
```
### Flutter
```
flutter/
├── keys_localizations.dart
└── sources_localizations.dart
```
## 💡 Examples
### Complete Android Project Setup
```shell
# Navigate to your Android project
cd MyAndroidApp
# Generate all localizations
localizegen -platform android \
-target ./app/src/main/res \
-document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU \
-sheet 0
```
### iOS with Custom Path
```shell
# Generate iOS localizations with custom path
localizegen -platform ios \
-target ./MyApp/Resources/Localizations \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
### Flutter Single Language
```shell
# Generate only English for Flutter
localizegen -platform flutter \
-target ./lib/l10n \
-locale en \
-document YOUR_DOCUMENT_ID \
-sheet YOUR_SHEET_ID
```
## 🔧 Troubleshooting
### Common Issues
1. **Permission Denied**: Make sure your Google Sheet is publicly accessible
2. **Invalid Sheet ID**: Double-check the extracted DocumentId and SheetId
3. **Missing Dependencies**: Ensure Go is properly installed for source installation
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 💖 Support
If you find this tool helpful, please consider buying me a coffee:
[](https://www.buymeacoffee.com/prongbang)
---