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

fix: Translate ISO 8601 Datetime Durations During Scraping/Parsing/Migrating #2810

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

Adds backend translations to the ISO 8601 time duration parsing

Which issue(s) this PR fixes:

(REQUIRED)

Mostly fixes #2807 (see below)

Special notes for your reviewer:

(fill-in or delete this section)

Most of the PR is properly propagating the localizer down to the scraper/cleaning functions. I also had to implement some logic to properly parse "plural" translations. I'm not sure why we have a manual implementation for i18n parsing on the backend, but I basically followed the Vue docs and mirrored that functionality (and added tests)

Part of #2807 mentions that "serving" isn't translated, but looking at the example website source there is no word (it's just the number "1"). I tried my best to find where the word "serving" gets added, but I can't find it. I think it's somewhere deep in the recipe scrapers library, but I'm not sure. It's not in Mealie (I did a painfully exhaustive search for the word "serving" in the codebase). I thought it might get added in the cleaning process, but it definitely doesn't

Testing

(fill-in or delete this section)

Pytest

@michael-genson
Copy link
Collaborator Author

It takes like 18 years for tests to run on my instance but it took 5 minutes to run on GH...

Copy link
Collaborator

@boc-the-git boc-the-git left a comment

Choose a reason for hiding this comment

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

LGTM!

@boc-the-git boc-the-git merged commit 3174216 into mealie-recipes:mealie-next Feb 8, 2024
9 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.

[SCRAPER] - Units for "Servings", "Minutes" and "Hour" missing in German localization
2 participants