Command line tools for extracting and importing translations from and to excel files
Project description
translations-util
Command line tools for extracting and importing translations from and to Excel files.
Installation
To install the dependencies for this project, use Poetry:
poetry install
Usage
This tool allows you to update translations in a TypeScript file based on an Excel file. The Excel file should contain the translations in a specific format.
Command Line Usage
python update_translations.py <excel_file_path> <language_sheet_name> <ts_file_path>
<excel_file_path>: Path to the Excel file containing the translations.<language_sheet_name>: Name of the sheet in the Excel file that contains the translations.<ts_file_path>: Path to the TypeScript file to be updated.
Example
python update_translations.py translations.xlsx French translations.ts
This command will update the translations.ts file with the French translations from the translations.xlsx file.
Excel File Format
The Excel file should have at least three columns:
- Key: The key for the translation.
- English Text: The original English text.
- Translation: The translated text.
Features
- Placeholder Matching: Ensures that placeholders in the format
{variable}are consistent between the English text and the translation. - Translation Blocks: Detects and processes translation blocks marked by
// TODO: vvv Translate below vvvand// TODO: ^^^ Translate above ^^^.
Development
To contribute to this project, clone the repository and install the dependencies using Poetry:
git clone <repository-url>
cd translations-util
poetry install
License
This project is licensed under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file translations_util-0.1.0.tar.gz.
File metadata
- Download URL: translations_util-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.10 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4794616c473269bc999def4a7f11cccf86051d1632ec35f54e5bf05b8e9eb77d
|
|
| MD5 |
06f55956c42a5aa24bfad842bd29d562
|
|
| BLAKE2b-256 |
7f7e5f81ec6a145010e2670b6e00ff0d850922e7b944df93607d0940fe964c7f
|
File details
Details for the file translations_util-0.1.0-py3-none-any.whl.
File metadata
- Download URL: translations_util-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.10 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96f79e17168c6e4161a1ecccac34faedca61f4259400f2bd1519eaee7fb15475
|
|
| MD5 |
cf224680a3c02e488b44135e37816818
|
|
| BLAKE2b-256 |
a5224e24a5daec59af9fc3c2672f013d58e2386b0e46b022568a0c4cc7292b1a
|