Skip to content

Commit

Permalink
Merge pull request #1006 from City-of-Helsinki/UHF-10120
Browse files Browse the repository at this point in the history
UHF-10120: Add language to request + UHF-9289 fixes backend error messages in frontend
  • Loading branch information
sundflux authored Jun 13, 2024
2 parents ef5b399 + 4dc123c commit f3192d5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
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."

0 comments on commit f3192d5

Please sign in to comment.