feat: Add .po file pseudolocalization to example web app#24
Open
RomanPszonka wants to merge 1 commit intomainfrom
Open
feat: Add .po file pseudolocalization to example web app#24RomanPszonka wants to merge 1 commit intomainfrom
RomanPszonka wants to merge 1 commit intomainfrom
Conversation
This update enhances the example web application by adding support for
pseudolocalizing Gettext PO (.po) files.
Key changes include:
- I modified the web UI (`pseudolocalize_template.html`) to include a new
form for uploading `.po` files.
- I updated the Flask application (`app.py`) with a new endpoint
(`/pseudol10nutil/po_upload`) that:
- Accepts `.po` file uploads.
- Uses `POFileUtil` from the `pseudol10nutil` library to perform
pseudolocalization on the file content.
- Returns the processed `.po` file to you for download.
- Includes error handling for invalid file types or processing issues.
- I added comprehensive unit tests (`test_app.py`) for the new file upload
functionality, covering success cases and various error scenarios.
Existing tests were also refactored to use Flask's test client.
This addresses the TODO item "Add support for pseudolocalizing files
through the web app" by leveraging the `POFileUtil` class already
present in the `pseudol10nutil` library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This update enhances the example web application by adding support for pseudolocalizing Gettext PO (.po) files.
Key changes include:
pseudolocalize_template.html) to include a new form for uploading.pofiles.app.py) with a new endpoint (/pseudol10nutil/po_upload) that:.pofile uploads.POFileUtilfrom thepseudol10nutillibrary to perform pseudolocalization on the file content..pofile to you for download.test_app.py) for the new file upload functionality, covering success cases and various error scenarios. Existing tests were also refactored to use Flask's test client.This addresses the TODO item "Add support for pseudolocalizing files through the web app" by leveraging the
POFileUtilclass already present in thepseudol10nutillibrary.