-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Multilingual Emails #8044
Multilingual Emails #8044
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and works as expected.
I'm not sure if some of the new files are in the preferred location - I will let others comment on if some of the new files should be placed in different location.
LGTM. |
Tested with the default configuration (no languages configured), I get a It fails internally in It happens also when configuring the languages in the settings. |
…lingual-emails # Conflicts: # core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java # core/src/main/java/org/fao/geonet/util/XslUtil.java # index/src/main/java/org/fao/geonet/index/es/EsRestClient.java
Reproduced the first issue and it seems to be fixed after merging the changes from #8042.
I am however unable to reproduce the issue while configuring the languages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, the error is solved.
Please wait to merge it until 4.4.5
is released.
} catch (MissingResourceException e) { | ||
failedToFindASpecificTextTemplate = true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
if ((failedToFindASpecificSubjectTemplate) && (failedToFindASpecificTextTemplate)) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added loop breaking logic in latest push
# Conflicts: # services/src/main/java/org/fao/geonet/api/users/RegisterApi.java
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8044-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 146f1846bc4a660175911d637aaa3747878acd95,c7c49917de61879bc6ea2b445548259b784bf585,80a7d267b665062cbe40a497aeaad96af7a664a0,acf4147484bd09d9619059c36a3689a47e6ac741,88f20681d008692b2b03f843a7440107ad4778c4,3fab7c320f280cbc11e5898b56ca3f16d4ed77a9,da0f5450d6dd0cec45e96c093e267a2a78916761,cc8310172a9811c474716503fc36a372999c05be,3d6b6cee7a70f7cca377a5fdbf881bf823e85165,9988d7d8a0fe1edcbdeb6f180cb7faa1f90ceacf,c94dd7b6b6301084cac0943561e20e7b947ff381,461e4c5112929420ae2ea0409cff56f8c2d6271d,a8f4d1126e1d5aa7a431fbfb0e53eee76a148a0e,bd1dc23c6dfef3b6da210e15f9b1f1a50d3b2578,3f5a3af79fd74049a48b36b9f614d0522a9460bd,2a56de3a52f2e1c5683756f7cb480aee93bf03c2,4319bb67c4e786649744ef01d8fb4dfe89cdf55a,ae96904af72a3fef40fb8deeded6f56d2d28b746,6c4f65307ea3c50c3233a03be2661115ad7c446e,cbcdf2dd39fe347d32a0f4f4709788082a9a2782,b3c45475304024437b79bbca28a645b268822fca,54719604fc2d586fae3401cb346a7979c2100d81,c2599a4c7f35d3b1c5d22bdab867c9d8b35168f5,5e8d4b54236621c12ec4d8c6474b79c8e8e5fbf4,4d6825fa78439641bb6ffc6fcd19a28386fa1e1c
# Push it to GitHub
git push --set-upstream origin backport-8044-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x Then, create a pull request where the |
* Add settings fields for localized emails * Add spring bean to initialize feedback email locales from settings field * Modify settings manager to update feedback locales when the settings fields are saved * Create classes for localized emails, their components, and the components' parameters * Implement lang in getIndexField * Localize workflow status emails * Localize metadata publication emails * Localize user feedback emails * Localize RegisterApi emails * Localize PasswordApi emails * Localize WatchListNotifier emails * Localize MailApi emails * Update migration script to only insert settings fields if not present * Add static enum imports for readability * Log a warning when a locale is invalid or missing * Update log modules and messages * Trim language codes defined in settings to handle spaces after commas * Rename translation follows label to translation follows text for consistency * Add back resource bundle 'messages' that was unused before merging main * Add logic to break from loop when email subject and text messages fail
* Add settings fields for localized emails * Add spring bean to initialize feedback email locales from settings field * Modify settings manager to update feedback locales when the settings fields are saved * Create classes for localized emails, their components, and the components' parameters * Implement lang in getIndexField * Localize workflow status emails * Localize metadata publication emails * Localize user feedback emails * Localize RegisterApi emails * Localize PasswordApi emails * Localize WatchListNotifier emails * Localize MailApi emails * Update migration script to only insert settings fields if not present * Add static enum imports for readability * Log a warning when a locale is invalid or missing * Update log modules and messages * Trim language codes defined in settings to handle spaces after commas * Rename translation follows label to translation follows text for consistency * Add back resource bundle 'messages' that was unused before merging main * Add logic to break from loop when email subject and text messages fail
* Add settings fields for localized emails * Add spring bean to initialize feedback email locales from settings field * Modify settings manager to update feedback locales when the settings fields are saved * Create classes for localized emails, their components, and the components' parameters * Implement lang in getIndexField * Localize workflow status emails * Localize metadata publication emails * Localize user feedback emails * Localize RegisterApi emails * Localize PasswordApi emails * Localize WatchListNotifier emails * Localize MailApi emails * Update migration script to only insert settings fields if not present * Add static enum imports for readability * Log a warning when a locale is invalid or missing * Update log modules and messages * Trim language codes defined in settings to handle spaces after commas * Rename translation follows label to translation follows text for consistency * Add back resource bundle 'messages' that was unused before merging main * Add logic to break from loop when email subject and text messages fail
* Add settings fields for localized emails * Add spring bean to initialize feedback email locales from settings field * Modify settings manager to update feedback locales when the settings fields are saved * Create classes for localized emails, their components, and the components' parameters * Implement lang in getIndexField * Localize workflow status emails * Localize metadata publication emails * Localize user feedback emails * Localize RegisterApi emails * Localize PasswordApi emails * Localize WatchListNotifier emails * Localize MailApi emails * Update migration script to only insert settings fields if not present * Add static enum imports for readability * Log a warning when a locale is invalid or missing * Update log modules and messages * Trim language codes defined in settings to handle spaces after commas * Rename translation follows label to translation follows text for consistency * Add back resource bundle 'messages' that was unused before merging main * Add logic to break from loop when email subject and text messages fail Co-authored-by: tylerjmchugh <163562062+tylerjmchugh@users.noreply.github.com>
Emails are currently sent in the UI language of the sender regardless of the preferences of the receiver.
This PR implements a framework for generating multilingual emails including:
Email messages for all specified languages will be concatenated with a separator.
If the settings fields are left empty, default back to the UI language.
Related feature request: #7966
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation