An open API service indexing awesome lists of open source software.

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: about 2 months ago
JSON representation

Generate Localization tools for Mobile Application an Android, iOS, Flutter

Awesome Lists containing this project

README

        

# localizegen

```shell
__ ___
/ /__ _______ _/ (_)__ ___ ___ ____ ___
/ / _ \/ __/ _ `/ / /_ // -_) _ `/ -_) _ \
/_/\___/\__/\_,_/_/_//__/\__/\_, /\__/_//_/
/___/
--> START
# Platform: ios
# Language: en
# Generate: localization
> Create ./App/Locallization/Translate.swift -> Success
> Create ./App/Locallization/en.lproj/Localizable.strings -> Success
<-- DONE
```

Generate Localization tools for Mobile Application an Android, iOS

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/prongbang)

## Setup

- 1. Create a Google Sheet

![Localize](/docs/sheet-localize.png)

- 2. Extract from the link the `DocumentId` and `SheetId` values

```shell script
https://docs.google.com/spreadsheets/d//edit#gid=
```

Example

```shell script
https://docs.google.com/spreadsheets/d/1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU/edit#gid=0
```

- `DocumentId`  = `1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU`
- `SheetId`        = `0`

## Download

### Homebrew

```shell
$ brew update
$ brew tap prongbang/homebrew-formulae
$ brew install localizegen
```

### Binary

- [macOS](https://github.com/prongbang/localizegen/blob/master/localizegen?raw=true)
- [Linux](https://github.com/prongbang/localizegen/blob/master/binary/linux/localizegen?raw=true)
- [Mindows](https://github.com/prongbang/localizegen/blob/master/binary/windows/localizegen.exe?raw=true)

### Golang

```shell
$ go install github.com/prongbang/localizegen
```

## Flag

- `-platform` : `android` or `ios` *require
- `-target`     :  Target path
- `-locale`     : `en`, `th`, etc
- `-document` :  Google sheet document id *require
- `-sheet`       :  Google sheet id *require
- `-filename` :  Custom file name

## Android

- Generate by language

```shell script
$ localizegen -platform android -target ./app/src/main/res -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

- Generate all language supported

```shell script
$ localizegen -platform android -target ./app/src/main/res -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

Output

```shell
android
├── values
│   └── strings.xml
├── values-de
│   └── strings.xml
├── values-es
│   └── strings.xml
├── values-fr
│   └── strings.xml
├── values-hi
│   └── strings.xml
├── values-ja
│   └── strings.xml
├── values-pt
│   └── strings.xml
├── values-ru
│   └── strings.xml
├── values-th
│   └── strings.xml
└── values-zh
└── strings.xml
```

## iOS

- Generate by language

```shell script
$ localizegen -platform ios -target ./ProjectName/Locallization -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

- Generate all language supported

```shell script
$ localizegen -platform ios -target ./ProjectName/Locallization -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

Output

```shell
ios
├── Localizables.swift
├── de.lproj
│   └── Localizable.strings
├── en.lproj
│   └── Localizable.strings
├── es.lproj
│   └── Localizable.strings
├── fr.lproj
│   └── Localizable.strings
├── hi.lproj
│   └── Localizable.strings
├── ja.lproj
│   └── Localizable.strings
├── pt.lproj
│   └── Localizable.strings
├── ru.lproj
│   └── Localizable.strings
├── th.lproj
│   └── Localizable.strings
└── zh.lproj
└── Localizable.strings
```

## Flutter

- Generate by language

```shell script
$ localizegen -platform flutter -target ./ProjectName/Locallization -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

- Generate all language supported

```shell script
$ localizegen -platform flutter -target ./ProjectName/Locallization -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
```

Output

```shell
flutter
├── keys_localizations.dart
└── sources_localizations.dart
```