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

UHF-10120: Add language to request + UHF-9289 fixes backend error messages in frontend #1006

Merged
merged 6 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/js/job-search.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const SearchMonitorContainer = () => {
query: currentRelativeUrl,
email,
search_description: searchDescription,
// lang is filled by Drupal module
lang
lang: window.drupalSettings.path.currentLanguage || 'fi'
};

const onSubmit = async (
Expand Down Expand Up @@ -108,9 +107,8 @@ const SearchMonitorContainer = () => {

// Oops, error from backend
if (!response.ok) {
seterrorMessage(
`Error submitting form: ${response.statusText}`,
);
console.log(response.statusText);
seterrorMessage(Drupal.t('Saving search failed. Please try again.', {}, { context: 'Search monitor error submitting' }));
if (submitButton) {
submitButton.removeAttribute('disabled');
}
Expand Down
4 changes: 4 additions & 0 deletions translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -1273,3 +1273,7 @@ msgstr "Valinta on pakollinen: Käyttöehdot"
msgctxt "Search monitor error email"
msgid "This field is mandatory: Email address"
msgstr "Kenttä on pakollinen: Sähköpostiosoite"

msgctxt "Search monitor error submitting"
msgid "Saving search failed. Please try again."
msgstr "Hakuvahdin tilaus epäonnistui. Yritä uudestaan."
4 changes: 4 additions & 0 deletions translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -1275,3 +1275,7 @@ msgstr "Valet är obligatoriskt: Användningsvillkor"
msgctxt "Search monitor error email"
msgid "This field is mandatory: Email address"
msgstr "Fältet är obligatoriskt: E-postadress"

msgctxt "Search monitor error submitting"
msgid "Saving search failed. Please try again."
msgstr "Sparad sökning misslyckades. Var god att försök igen."