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

invite email translation now happens on the fly #1250

Closed
wants to merge 4 commits into from
Closed

invite email translation now happens on the fly #1250

wants to merge 4 commits into from

Conversation

afriedman412
Copy link

Fixes #869

Invite emails were hard coded and could not be translated using the existing code base. This change runs the (already rendered) email body through a Jinja {% trans %} tag.

There's a new function to do this (utils. translate_template_text) and it can be generalized to other emails if need be!

Copy link
Member

@almet almet left a comment

Choose a reason for hiding this comment

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

I don't understand why we need a level of indirection here. Adding {% trans %} blocks in the templates should be working.

If it's not, we need to figure out why :-)

.gitignore Outdated
@@ -18,3 +18,5 @@ ihatemoney/budget.db
.python-version
.coverage*
prof
*.ipynb
*/.ipynb_checkpoints/
Copy link
Member

Choose a reason for hiding this comment

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

I believe these should be better in your global ~/.gitignore file maybe?

Copy link
Author

Choose a reason for hiding this comment

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

didnt know that was possible! fixed

@@ -1,3 +1,5 @@

Copy link
Member

Choose a reason for hiding this comment

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

I don't believe we need the extra spaces here. Any reason you added them?

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@almet
Copy link
Member

almet commented Oct 19, 2023

Anyway, thanks for taking a look at this =D

@afriedman412
Copy link
Author

I don't understand why we need a level of indirection here. Adding {% trans %} blocks in the templates should be working.

If it's not, we need to figure out why :-)

aight well you know what they say about the perfect and the good

@@ -17,4 +17,4 @@ ihatemoney/budget.db
.idea
.python-version
.coverage*
prof
prof
Copy link
Member

Choose a reason for hiding this comment

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

Please, do not remove the newline at the end of files :-)

@@ -0,0 +1,3 @@
{% trans %}
{{ untranslated_text }}
{% endtrans %}
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@almet
Copy link
Member

almet commented Oct 19, 2023

aight well you know what they say about the perfect and the good

Have you tried to understand what's going on here? If it's not working then we need to understand why and potentially open a bug upstream :)

@zorun
Copy link
Collaborator

zorun commented Oct 20, 2023

take it or leave it

Thanks for the proposed change, but that's not the way we work here. And in general I believe it's not the right approach to contribute to open source projects.

About the change itself: have you verified it actually works? That is: 1) that you were able to extract the text to translate into the translation catalog, and 2) that a translation of this text in the catalog correctly shows up. It seems to me that the indirection will prevent the extraction from working.

@almet
Copy link
Member

almet commented Oct 23, 2023

iuno man you wanted to "Allow translation of invitation emails"

this allows translation of invitation emails (and any other emails you don't want to have to translate manually into other languages)

take it or leave it

Hi @afriedman412. I'm sorry to see your comments and understand your frustration. I can only hope you understand ours. As @zorun mentioned, the "Take it or leave it" is not how we chose to work on this project. We are open to the conversation, but as maintainers have the final say into what's merged or not, and code quality is one of our concerns.

So, let me try to be more precise in my feedback: I'm surprised we have to do an indirection here in the code, and I don't understand why we have to do it. It seems that something weird is happening, and might be related to how we configured Jinja, or how we call it.

I also want to add that I'm only criticizing here the code you wrote, and not you. Again : thanks for your contribution here, and I hope you're well. Don't hesitate to ask if you need some help.

PS : Thanks @zorun for the clarifications and help here 👍

@afriedman412
Copy link
Author

iuno man you wanted to "Allow translation of invitation emails"
this allows translation of invitation emails (and any other emails you don't want to have to translate manually into other languages)
take it or leave it

Hi @afriedman412. I'm sorry to see your comments and understand your frustration. I can only hope you understand ours. As @zorun mentioned, the "Take it or leave it" is not how we chose to work on this project. We are open to the conversation, but as maintainers have the final say into what's merged or not, and code quality is one of our concerns.

So, let me try to be more precise in my feedback: I'm surprised we have to do an indirection here in the code, and I don't understand why we have to do it. It seems that something weird is happening, and might be related to how we configured Jinja, or how we call it.

I also want to add that I'm only criticizing here the code you wrote, and not you. Again : thanks for your contribution here, and I hope you're well. Don't hesitate to ask if you need some help.

PS : Thanks @zorun for the clarifications and help here 👍

hi -- thanks for revisiting this! it looks like this is going to take a bit more hands-on translation work than I expected, so I'll pass on it for now.

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.

Allow translation of invitation emails
3 participants