Skip to content

Latest commit

 

History

History
175 lines (134 loc) · 4.22 KB

README.md

File metadata and controls

175 lines (134 loc) · 4.22 KB

localizegen

   __              ___                     
  / /__  _______ _/ (_)__ ___ ___ ____ ___ 
 / / _ \/ __/ _ `/ / /_ // -_) _ `/ -_) _ \
/_/\___/\__/\_,_/_/_//__/\__/\_, /\__/_//_/
                            /___/          
--> 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"

Setup

    1. Create a Google Sheet

Localize

    1. Extract from the link the DocumentId and SheetId values
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

Download

Homebrew

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

Binary

Golang

$ 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
$ localizegen -platform android -target ./app/src/main/res -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
  • Generate all language supported
$ localizegen -platform android -target ./app/src/main/res -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0

Output

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
$ localizegen -platform ios -target ./ProjectName/Locallization -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
  • Generate all language supported
$ localizegen -platform ios -target ./ProjectName/Locallization -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0

Output

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
$ localizegen -platform flutter -target ./ProjectName/Locallization -locale en -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0
  • Generate all language supported
$ localizegen -platform flutter -target ./ProjectName/Locallization -document 1r91ECV-As0XtuqGKXU7dXnoY4og9XPBoCqwRcdio6EU -sheet 0

Output

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