Skip to content

Conversation

@pescheck-bram
Copy link
Contributor

Summary

Makes the --lang parameter optional by implementing automatic language detection from PO file metadata and folder structure. This improves user experience by eliminating
the need to manually specify target languages when they can be automatically determined.

Changes

Core Functionality

  • Auto-detection from PO metadata: Reads Language field from PO file headers
  • Auto-detection from folder structure: Uses --folder-language to detect from directory names (e.g., locale/fr/, i18n/de/)
  • Fallback behavior: -l parameter still works as override when explicit control is needed

Code Changes

  • Moved --lang from required to optional in CLI argument parser
  • Simplified main logic to use existing LanguageDetector.validate_or_detect_languages() method
  • Updated help text and examples to show auto-detection as recommended approach

Documentation Updates

  • Updated README.md with auto-detection examples
  • Updated docs/usage.md to reflect optional nature of --lang
  • Updated CLI help text with new usage patterns

Bug Fixes

  • Fixed deprecated pkg_resources warning by migrating to importlib.metadata
  • Removed unused imports and fixed linting issues

@pescheck-bram pescheck-bram merged commit 6e541df into main Aug 14, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants