Skip to main content

A python script that generates localization files for iOS and Android projects from a public GoogleSheet.

Project description

Localization Sync

This is a python script that downloads localization strings and CI color information from a public Google Sheet and generates resource files for iOS and Android projects.

Vizualization of the workflow

Installation

This uses the pip package manager for Python packages (see guide). It depends on the pyexcel-ods package which will be installed alongsite automatically when you run:

pip install localization-sync

Hint: It could be that you need to use pip3 command instead of pip.

Prerequisites

1. Create a Google Sheet

Create a Google Sheet document with sheets like these:

Example of a L10n table Example of a colors table

Mind to not add extra columns or rows at the top/left of your tables. I you need to do so, use keyRow/keyColumn parameters in config to inset the parsing of the table.

2. Publish

Publish the sheeet to the web by pressing File -> Publish to the web. Select Whole Document and Website. This enables the script do export the contents of the sheet as ODS file.

Note: We are using the export instead of the JSON API. Because this way there is no need for creating an API Key and using OAuth on the client (your) side.

3. Get the ID

Find the ID of your document by copying it from your browsers address bar.

sheet_url.png

Usage

Create a data_sync.config.json in your project and populate it with the contents of the example config. Replace the sheetId with your own. You can modify the other settings to fit the needs of your project.

Then open a terminal at your project path and run l10n_sync. Look for your newly created resource files.

You can also copy data_sync.py to your project and then run python3 data_sync.py when your config file is ready.

Example

Have a look into the Output folder for some example files generated by using the provided configuration file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localization-sync-0.2.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

localization_sync-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file localization-sync-0.2.0.tar.gz.

File metadata

  • Download URL: localization-sync-0.2.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.8

File hashes

Hashes for localization-sync-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b781da0e5925c3a6efefe661efa80d18300b5c9ebc12856da1d1e611e37cd7d4
MD5 876d7d3d85746207e3301468f96f5a7a
BLAKE2b-256 f95e452d25c2404e12f18f4d163cbca099d02b452329a686e410ab21c1d672a3

See more details on using hashes here.

File details

Details for the file localization_sync-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for localization_sync-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e11e32de5cf21bc2ba77d9296025a744b53ad268e23b71b622d89387fa78f7ae
MD5 3034bdd997817c4918c5fc3e2ce038cf
BLAKE2b-256 cd1837fe2815283274bff5517dedadfd187c185aaca144dd6892aa8505122f76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page