Lime-translate is a Python library designed to improve compatibility between Limesurvey and computer-assisted translation (CAT) software.
Project description
Lime-translate 0.0.1a0
Lime-translate is a Python library designed to improve compatibility between Limesurvey and computer-assisted translation (CAT) software. Currently, it can convert Limesurvey files (LSS) to the XLIFF format used by computer-assisted translation software, and reintegrate the translated file into the original LSS file.
Current features
- conversion from LSS to XLIFF
- reintegrating a translated XLIFF file into a LSS file
This is an alpha version, so use it at your own risks!
Installation
pip install lime-translate
Motivation
Limesurvey is an open-source statistical survey web application. It already offers a translation interface for multilingual surveys, but this translation interface is quite rudimentary compared to the features offered by modern computer-assisted translation tools (OmegaT, weblate, etc). In addition, Limesurvey currently does not offer an export format directly compatible with these CAT tools.
The lime-translate package is meant to fill this current compatibility gap between Limesurvey and computer-assisted translation tools.
Usage example
Bob creates a survey in Limesurvey, in English. He wants to have this questionnaire translated to French by a professional translator, Alice, who generally uses computer-assisted translation (CAT) software. As the survey is particularly complex, using CAT software would be much more quick and effective than using the native Limesurvey "quick translation" interface.
Bob creates an export of his survey to the LSS format. However, he and Alice quickly realize that this format is not compatible with the CAT software Alice uses. Therefore, Bob converts the LSS file to the CAT-friendly XLIFF format, using the lime-translate package:
import lime_translate as lt
lss_file_path = "./bob_survey/source_english.lss"
xliff_files = lt.lss_to_xliff(lss_file_path=lss_file_path)
target_fr_path = "./bob_survey/translation_files/to_translate/english_to_french.xliff"
with open(target_fr_path, "wb") as f:
f.write(xliff_files["fr"])
Bob then transmits the new "english_to_french.xliff" file to Alice for translation.
Alice translates the XLIFF file in her CAT tool. Once it's done, she transmits the translated XLIFF file back to Bob. Bob then integrates the translation into the original LSS file, using the following code:
import lime_translate as lt
original_LSS_path = "./bob_survey/source_english.lss"
xliff_file_path = "./bob_survey/translation_files/translated/english_to_french.xliff"
updated_lss = lt.xliff_to_LSS(xliff_file_path, original_LSS_path)
with open("./bob_survey/translated/bilingual_en_fr.lss", "wb") as f:
f.write(updated_lss)
Tadam! Bob will then be able to immediately import the resulting translated survey file ("bilingual_en_fr.lss") into Limesurvey.
Exporting an LSS file from Limesurvey
To ensure your LSS file will work seamlessly with lime-translate, before exporting the LSS file from Limesurvey, you must add your target language to the "additional languages" section in the Limesurvey admin interface.
Limitations, compatibility with Limesurvey versions, etc.
While it is planned to support more recent versions of Limesurvey, the package is currently only compatible with LSS files exported from Limesurvey 3.x.
The only supported export format is XLIFF, while the package is also planned to support other formats in the future.
This is an alpha version, initially developed as an experiment for a one-time translation project. While it worked quite well for this specific project, it has not been tested extensively. The package is also missing a proper documentation, though a relatively straightforward usage example is provided above.
Any feedback is welcome, but use it at your own risks!
Project details
Release history Release notifications | RSS feed
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 lime_translate-0.0.1a0.tar.gz.
File metadata
- Download URL: lime_translate-0.0.1a0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e43934c1fd6995d70b8163599f16e73125b1de5cef32ade64d32b033fc6abf
|
|
| MD5 |
9379ed4692f5853f2cc504505b64b4bd
|
|
| BLAKE2b-256 |
08c2666a9e2edf10f48b93ef6e945c1810e2f081e7c81e88b388a3ace6e05533
|
File details
Details for the file lime_translate-0.0.1a0-py3-none-any.whl.
File metadata
- Download URL: lime_translate-0.0.1a0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c49303c342307eec1d022fa35327ddbe3683c9635a0cd91343119b1e2afbd021
|
|
| MD5 |
55e6bcafca89a07d7a7a700b8358d4bf
|
|
| BLAKE2b-256 |
4e97fc336a5f63b889a615eb742bd25d5cbb88806836cb775efa446d47d64d74
|