Make --lang parameter optional with auto-detection from PO files #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Makes the
--langparameter optional by implementing automatic language detection from PO file metadata and folder structure. This improves user experience by eliminatingthe need to manually specify target languages when they can be automatically determined.
Changes
Core Functionality
Languagefield from PO file headers--folder-languageto detect from directory names (e.g.,locale/fr/,i18n/de/)-lparameter still works as override when explicit control is neededCode Changes
--langfrom required to optional in CLI argument parserLanguageDetector.validate_or_detect_languages()methodDocumentation Updates
--langBug Fixes
pkg_resourceswarning by migrating toimportlib.metadata