Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MIME type and file extension mappings into separate modules #4

Open
6 tasks
chigwell opened this issue Jan 31, 2024 · 0 comments
Open
6 tasks

Comments

@chigwell
Copy link
Owner

As a developer, I would like to refactor the MIME type and file extension mappings in the detect_language() function of lang.py to separate modules, to improve code organization and maintainability.

Background

The current implementation of the detect_language() function in lang.py has mappings for MIME types and file extensions defined within the same file.

Proposed Changes

  1. Create mime_mappings.py module containing the mime_to_language dictionary.
  2. Create extension_mappings.py module containing the extension_to_language dictionary.
  3. Update detect_language() function to import mappings from the new modules.

Acceptance Criteria

  • A new module mime_mappings.py is created containing the mime_to_language dictionary.
  • A new module extension_mappings.py is created containing the extension_to_language dictionary.
  • The detect_language() function is updated to import mappings from the new modules.
  • The mime_to_language and extension_to_language dictionaries in the new modules are kept in sync with the original mappings in lang.py.
  • The lang.py file is updated to remove the original mappings for MIME types and file extensions.
  • The changes do not introduce any new bugs or issues in the detect_language() function.

========
generated by LLM

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

No branches or pull requests

1 participant