Skip to content

Q-Agency/Localization-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Localization Generators 🌐

Easily convert your .arb files to .xlsx and vice versa with these two Python scripts.

Requirements 📋

Before running the scripts, make sure you have installed the following libraries:

  • Python 3.x
  • os
  • csv
  • json
  • collections
  • Tkinter library (pre-installed in most Python installations)
  • pandas
  • openpyxl
  • PIL

You can install the libraries by running the following command in your terminal:

pip install os csv json collections tkinter pandas openpyxl pillow
# or
pip3 install os csv json collections tkinter pandas openpyxl pillow

Script 1: 'arb_to_excel.py'

This script helps you generate a translation file in .xlsx format from multiple .arb files in a project folder

Here is the example:

Arb to Excel

How To Use 🚀

python arb_to_excel.py
# or
python3 arb_to_excel.py

This script contains functions to select the root of project folder, parse the ARB files, and generate Excel file. The following steps are performed:

  1. Select the project folder
  2. Extract the path of the project folder
  3. Create a list of all .arb files in the "/lib/l10n" folder
  4. Parse the contents of the "intl_en.arb" file as a JSON objectt
  5. Parse the contents of the remaining .arb files as JSON objects and append them to the data dictionary
  6. Convert the .arb files to an Excel file and save it in the "/lib/l10n" folder

Script 2: 'excel_to_arb.py'

This script helps you generate multiple .arb files from an excel file. If a value doesn't exist, the corresponding key-value pair will not be present in the .arb file.

Here is the example:

Excel to Arb

How To Use 🚀

python excel_to_arb.py
# or
python3 excel_to_arb.py

This script contains functions to select the excel file, select destination folder where .arb files will be saved. The steps taken by the script are:

  1. Select the .xlsx file
  2. Select the destination folder where .arb files will be sabed
  3. Convert the excel file to a CSV file and then to a dictionary
  4. Generate .arb files for different languages using the dictionary

Contributors ✨


Adrijan Omićević

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages