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

Allow Invitation Email Translation #1016

Closed

Conversation

a-angeles13
Copy link

Should address Issue #869

Added a generic invitation email template that uses jinja {% trans %} blocks to facilitate rendering without the render_localized_template function as suggested by almet.

I also modified the babel.cfg file to remove the jinja extensions as they are now included by default and were causing make update-translations to fail. I also modified some f-strings that were being used in conjunction with babel's gettext alias _() because this causes extraction errors with pybabel.

Modified budget_test.py to include a test of translated invite emails to ensure quality.

Language files in `ihatemoney/translations' should be ready to be populated with translations. Until then only English and French will be supported with unsupported languages defaulting to English.

@a-angeles13 a-angeles13 changed the title Fixing invitation_email translation Allow Invitation Email Translation Apr 21, 2022
@a-angeles13
Copy link
Author

a-angeles13 commented Apr 23, 2022

The check tests (3.7, minimal, postgresql; 3.7, minimal, mariadb; 3.9, minimal, sqlite; 3.10, minimal, sqlite) are failing due to depreciation in Werkzeug 2.1

Specifically, self.local.__ident_func__ in line 215 of <test_path>/werkzeug/local.py is now depreciated and will not work in Python versions 3.7+. This was noted in a warning on line 34 of test of 3.7, minimal, postgresql in a previously successful merge. link.

Copy of Warning excerpt mentioned above:
../home/runner/work/ihatemoney/ihatemoney/.tox/py/lib/python3.7/site-packages/werkzeug/local.py:215 /home/runner/work/ihatemoney/ihatemoney/.tox/py/lib/python3.7/site-packages/werkzeug/local.py:215: DeprecationWarning: '__ident_func__' is deprecated and will be removed in Werkzeug 2.1. It should not be used in Python 3.7+. return self._local.__ident_func__

I suggest that the merge check test suite be prioritized because any future pull requests will be blocked under any Werkzeug 2.1+.

Edit: Created new issue #1018

@Glandos
Copy link
Member

Glandos commented Apr 23, 2022

Hi, thanks for taking care of this!
First, yes, the tests are failing, and it's not your fault, as far as I see.

Secondly, could you remove all modifications done to .mo/.po files? They are handled by Weblate, so we only need modifications in messages.pot

Finally, it's an open question: do we want to have a lot of sentences to translate? In my opinion, the whole invitation email is a block in itself, translating it into small pieces will not bring any reuse cases, and it can be harder for translators to find the right wording. It will generate a big box with a loooooong string, but on the other end, the template will be much simpler, with only one {%trans%} tag pair.

@almet almet mentioned this pull request Dec 10, 2022
@almet
Copy link
Member

almet commented Dec 10, 2022

Superseded by #1101. Thanks for your work, trying to get it integrated :-)

@almet almet closed this Dec 10, 2022
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.

3 participants