Localizator is a Node.js program that automates the process of generating localization files for different platforms (web, iOS, and Android) using data from a Google Spreadsheet.
Before running the program, make sure you have the following:
- Node.js installed on your machine.
- A Google Cloud Platform project with the Google Drive API enabled.
- A
client_secret.json
file containing your Google Cloud Platform project credentials.
Step 2 and 3 can be done following those instructions: https://developers.google.com/drive/api/quickstart/nodejs
-
Clone the repository:
git clone https://github.com/LivioGama/localizator.git
-
Navigate to the project directory:
cd localizator
-
Install the dependencies:
npm install
-
Place your
client_secret.json
file in the project directory.
To run the program, use the following command:
node localizator.js [options]
--id
: Specify the ID of the Google Spreadsheet file to use for localization. If not provided, the program will prompt you to select a file from the list of available files.--gid
: Specify the ID of the sheet within the Google Spreadsheet file to use for localization. If not provided, the program will use the first sheet.--languages
: Specify a comma-separated list of languages to generate localization files for. Default is 'en'.--platform
: Specify the platform for which to generate localization files. Valid options are 'web', 'ios', and 'android'. Default is 'web'.--path
: Specify the output path for the generated localization files. Default is './'.--keep_csv
: Keep the temporary CSV file after generating the localization files.
To generate localization files for the web platform using a specific Google Spreadsheet file and the languages 'en' and 'fr' into an app in a monorepo located at apps/frontend/i18n
run:
node localizator.js --path=../frontend/i18n --id YOUR_FILE_ID --languages en,fr
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- Co-created by Livio Gamassia and Celian Moutafis and adapted to NodeJS.
- Uses the Google Drive API for accessing Google Spreadsheets.