Skip to content

Conversation

@Wurschdhaud
Copy link
Contributor

Description

adds a new helper script to extract all titles and tooltips. language and folder can be changed in code. reimport of csv possible.


Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Related Issues

If applicable, link the issues resolved by this pull request:

  • Resolves #[issue number]

https://discourse.pyrevitlabs.io/t/inquiry-about-chinese-simplified-language-support/9624/3


Additional Notes

Include any additional context, screenshots, or considerations for reviewers.


Thank you for contributing to pyRevit! 🎉

Copy link
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary:

This PR adds helper scripts to facilitate translation workflows for pyRevit extension bundles. The scripts enable:

  • Extraction of title/tooltip fields from YAML files to CSV for translation
  • Application of translated values back to YAML files
  • Support for multiple languages including Chinese Simplified

The tools aim to streamline the community translation efforts discussed in the discourse forum.

Review Summary:

Reviewed the translation helper scripts for logic correctness, data integrity, and error handling. Found one critical logic bug where path information is lost during CSV processing, causing incorrect behavior with nested YAML structures. Also identified a high-severity file corruption risk when write operations fail. The code follows Black formatting and PEP8 conventions as required.

Knowledge utilized: Exception handling standards from the review checklist emphasizing specific exception types over broad catching.

Follow-up suggestions:

  • @devloai fix the path information bug in comment #1 - Fix the critical logic issue with nested structures
  • @devloai add a README to extras/bundle_translations/ - Document the workflow and usage for future translators

@jmcouffin jmcouffin requested a review from Copilot December 2, 2025 19:42
@jmcouffin jmcouffin added the Localization Issues related to pyRevit localization [subsystem] label Dec 2, 2025
Copilot finished reviewing on behalf of jmcouffin December 2, 2025 19:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two Python helper scripts to facilitate translation workflows for pyRevit bundle YAML files. The scripts enable extraction of translatable strings (titles and tooltips) to CSV format and reimportation of completed translations back to the YAML files.

  • Introduces extract_translations.py to scan bundle YAML files and export translatable content to CSV
  • Adds apply_translations.py to read translated CSV files and update YAML files with new translations
  • Supports configurable source and target languages with focus on Chinese (Simplified) support

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 14 comments.

File Description
extras/bundle_translations/extract_translations.py Extracts title and tooltip fields from YAML files recursively, handling both multilingual dictionaries and scalar values, outputting to CSV
extras/bundle_translations/apply_translations.py Reads translations from CSV and applies them to YAML files, converting scalar fields to multilingual dictionaries as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Localization Issues related to pyRevit localization [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants