Skip to content

convert Excel file (.xlsx format) containing internationalization (i18n) data into JSON format.

Notifications You must be signed in to change notification settings

liemwellys/i18n-xlsx-to-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

i18n Excel File into JSON Converter

Convert Excel file (.xlsx format) containing internationalization (i18n) data into JSON format.

Key highlights

Input: .xlsx file with the following format:

  • sheet names representing parent keys in camelCase format (e.g., commonButton).

  • columns containing child keys, language codes, and values. Example:

    key zh-TW en-US
    apply 套用 Apply
    export 道出 Export
    send 送出 Send

Output:

  • Individual JSON files named with the date time and language code (e.g., 2024-05-30-11-30-en-US.json).

  • zh-TW json file sample output:

    {
      "commonButton": {
        "apply": "套用",
        "export": "道出",
        "send": "送出"
      }
    }
  • en-US json file sample output:

    {
      "commonButton": {
        "apply": "Apply",
        "export": "Export",
        "send": "Send"
      }
    }

Functionality:

  • Reads each sheet of the .xlsx file.
  • Extracts parent key (sheet name) and child keys (first column).
  • Iterates through each language code column.
  • Constructs a nested JSON dictionary with child keys as keys and corresponding values.

Benefits:

  • Improved efficiency and accuracy.
  • Reduced manual effort and error-proneness.
  • Enhanced data management and localization.

Required Package

  • pandas
  • json
  • os
  • datetime

About

convert Excel file (.xlsx format) containing internationalization (i18n) data into JSON format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages