diff --git a/app/javascript/mastodon/features/ui/containers/notifications_container.js b/app/javascript/mastodon/features/ui/containers/notifications_container.js index 5924197f1e8c09ea2830511f312e19075057f87f..b60a0216f628e22ec047b572e104bba2a275c697 100644 --- a/app/javascript/mastodon/features/ui/containers/notifications_container.js +++ b/app/javascript/mastodon/features/ui/containers/notifications_container.js @@ -1,11 +1,22 @@ +import { injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { NotificationStack } from 'react-notification'; import { dismissAlert } from '../../../actions/alerts'; import { getAlerts } from '../../../selectors'; -const mapStateToProps = state => ({ - notifications: getAlerts(state), -}); +const mapStateToProps = (state, { intl }) => { + const notifications = getAlerts(state); + + notifications.forEach(notification => ['title', 'message'].forEach(key => { + const value = notification[key]; + + if (typeof value === 'object') { + notification[key] = intl.formatMessage(value); + } + })); + + return { notifications }; +}; const mapDispatchToProps = (dispatch) => { return { @@ -15,4 +26,4 @@ const mapDispatchToProps = (dispatch) => { }; }; -export default connect(mapStateToProps, mapDispatchToProps)(NotificationStack); +export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(NotificationStack)); diff --git a/app/javascript/mastodon/locales/ar.json b/app/javascript/mastodon/locales/ar.json index 73680a1a1819be68d11570ca06c3ab1e6472c2fd..3d962079327bebb14eb5e49efdcc6cbe952dbf58 100644 --- a/app/javascript/mastodon/locales/ar.json +++ b/app/javascript/mastodon/locales/ar.json @@ -28,6 +28,8 @@ "account.unmute": "إلغاء الكتم عن @{name}", "account.unmute_notifications": "إلغاء كتم إخطارات @{name}", "account.view_full_profile": "عرض المل٠الشخصي كاملا", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "يمكنك ضغط {combo} لتخطّي هذه ÙÙŠ المرّة القادمة", "bundle_column_error.body": "لقد وقع هناك خطأ أثناء عملية تØميل هذا العنصر.", "bundle_column_error.retry": "إعادة المØاولة", diff --git a/app/javascript/mastodon/locales/bg.json b/app/javascript/mastodon/locales/bg.json index 1dee16748431562bc6d46d3b582e3606ede1ccfa..39eb05f2a84893cd66eca85c302858ac365c21c2 100644 --- a/app/javascript/mastodon/locales/bg.json +++ b/app/javascript/mastodon/locales/bg.json @@ -28,6 +28,8 @@ "account.unmute": "Unmute @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "You can press {combo} to skip this next time", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/ca.json b/app/javascript/mastodon/locales/ca.json index 3222daa2fc3509bc484a1c046e43f9f55460de82..33545d86f2d4a33a3307b76a2adb90ca07296955 100644 --- a/app/javascript/mastodon/locales/ca.json +++ b/app/javascript/mastodon/locales/ca.json @@ -28,6 +28,8 @@ "account.unmute": "Treure silenci de @{name}", "account.unmute_notifications": "Activar notificacions de @{name}", "account.view_full_profile": "Mostra el perfil complet", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Pots premer {combo} per saltar-te això el proper cop", "bundle_column_error.body": "S'ha produït un error en carregar aquest component.", "bundle_column_error.retry": "Torna-ho a provar", diff --git a/app/javascript/mastodon/locales/de.json b/app/javascript/mastodon/locales/de.json index e0fc0ee850bc8c91115daf12ac2cced2d41a1010..7bdb6a3c63d17568e1a93307516d34cdd3b2fbbe 100644 --- a/app/javascript/mastodon/locales/de.json +++ b/app/javascript/mastodon/locales/de.json @@ -28,6 +28,8 @@ "account.unmute": "@{name} nicht mehr stummschalten", "account.unmute_notifications": "Benachrichtigungen von @{name} einschalten", "account.view_full_profile": "Vollständiges Profil anzeigen", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Du kannst {combo} drücken, um dies beim nächsten Mal zu überspringen", "bundle_column_error.body": "Etwas ist beim Laden schiefgelaufen.", "bundle_column_error.retry": "Erneut versuchen", diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index d5b9c09cbf701192ffb09d7230ff8304a93f3559..b983823d4bb2472993b7dd24f2680a9e20b36c58 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -1734,5 +1734,18 @@ } ], "path": "app/javascript/mastodon/features/video/index.json" + }, + { + "descriptors": [ + { + "defaultMessage": "Oops!", + "id": "alert.unexpected.title" + }, + { + "defaultMessage": "An unexpected error occurred.", + "id": "alert.unexpected.message" + } + ], + "path": "app/javascript/mastodon/middleware/errors.json" } ] \ No newline at end of file diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index d0d863f797fef582ec46f34db287fbcf90d5e90f..5553772f4d2780a9b2aa12d3757210ae68f0e123 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -28,6 +28,8 @@ "account.unmute": "Unmute @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "You can press {combo} to skip this next time", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/eo.json b/app/javascript/mastodon/locales/eo.json index fd687e8b1036ab649e9bd133403b8d99d3ac64ce..35d9edf2ba5577cd0704ced90819bc5802734305 100644 --- a/app/javascript/mastodon/locales/eo.json +++ b/app/javascript/mastodon/locales/eo.json @@ -28,6 +28,8 @@ "account.unmute": "Malsilentigi @{name}", "account.unmute_notifications": "Malsilentigi sciigojn de @{name}", "account.view_full_profile": "Vidi plenan profilon", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Vi povas premi {combo} por preterpasi sekvafoje", "bundle_column_error.body": "Io misfunkciis en la Åargado de ĉi tiu elemento.", "bundle_column_error.retry": "Bonvolu reprovi", diff --git a/app/javascript/mastodon/locales/es.json b/app/javascript/mastodon/locales/es.json index 2107a15258dc2f1e7bf7f61b284f8b74dd94d185..e69938b0fa1ba90f057cf3efe9df4e8620898cd8 100644 --- a/app/javascript/mastodon/locales/es.json +++ b/app/javascript/mastodon/locales/es.json @@ -28,6 +28,8 @@ "account.unmute": "Dejar de silenciar a @{name}", "account.unmute_notifications": "Dejar de silenciar las notificaciones de @{name}", "account.view_full_profile": "Ver perfil completo", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Puedes presionar {combo} para saltear este aviso la próxima vez", "bundle_column_error.body": "Algo salió mal al cargar este componente.", "bundle_column_error.retry": "Inténtalo de nuevo", diff --git a/app/javascript/mastodon/locales/fa.json b/app/javascript/mastodon/locales/fa.json index 455dc5d9f5df0404b3226578c4591a37757d0f01..c9695d0a457c0c767ada9b8c2615e9b08ec8f4e9 100644 --- a/app/javascript/mastodon/locales/fa.json +++ b/app/javascript/mastodon/locales/fa.json @@ -28,6 +28,8 @@ "account.unmute": "باصدا کردن @{name}", "account.unmute_notifications": "باصداکردن اعلان‌ها از طر٠@{name}", "account.view_full_profile": "نمایش نمایهٔ کامل", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "دکمهٔ {combo} را بزنید تا دیگر این را نبینید", "bundle_column_error.body": "هنگام بازکردن این بخش خطایی رخ داد.", "bundle_column_error.retry": "تلاش دوباره", diff --git a/app/javascript/mastodon/locales/fi.json b/app/javascript/mastodon/locales/fi.json index 1741445edbb94e609024ca25c190ed0f6f9c1659..cbdffec106c355f85d543ac409e9d275c3e74f9e 100644 --- a/app/javascript/mastodon/locales/fi.json +++ b/app/javascript/mastodon/locales/fi.json @@ -28,6 +28,8 @@ "account.unmute": "Poista mykistys käyttäjältä @{name}", "account.unmute_notifications": "Poista mykistys käyttäjän @{name} ilmoituksilta", "account.view_full_profile": "Näytä koko profiili", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Voit painaa näppäimiä {combo} ohittaaksesi tämän ensi kerralla", "bundle_column_error.body": "Jokin meni vikaan tätä komponenttia ladatessa.", "bundle_column_error.retry": "Yritä uudestaan", diff --git a/app/javascript/mastodon/locales/fr.json b/app/javascript/mastodon/locales/fr.json index 40fd6163efecdc3d12651872584b93f8340034d5..8c56a7558382483993f90c319fc46b19107f289e 100644 --- a/app/javascript/mastodon/locales/fr.json +++ b/app/javascript/mastodon/locales/fr.json @@ -28,6 +28,8 @@ "account.unmute": "Ne plus masquer", "account.unmute_notifications": "Réactiver les notifications de @{name}", "account.view_full_profile": "Afficher le profil complet", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Vous pouvez appuyer sur {combo} pour pouvoir passer ceci, la prochaine fois", "bundle_column_error.body": "Une erreur s’est produite lors du chargement de ce composant.", "bundle_column_error.retry": "Réessayer", diff --git a/app/javascript/mastodon/locales/gl.json b/app/javascript/mastodon/locales/gl.json index edfb9cfcb9832294c18d755f135948a2e3c6117d..c5cedd60a7ff2f7a072d7cb784cce843daf11196 100644 --- a/app/javascript/mastodon/locales/gl.json +++ b/app/javascript/mastodon/locales/gl.json @@ -28,6 +28,8 @@ "account.unmute": "Non acalar @{name}", "account.unmute_notifications": "Desbloquear as notificacións de @{name}", "account.view_full_profile": "Ver o perfil completo", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Pulse {combo} para saltar esto a próxima vez", "bundle_column_error.body": "Houbo un fallo mentras se cargaba este compoñente.", "bundle_column_error.retry": "Inténteo de novo", diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index b637ae4147aa4a13100045f6a9442ec2ffc667f6..fe6f9bbb138b00f5535cc954d20f38027d14215c 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -28,6 +28,8 @@ "account.unmute": "הפסקת השתקת @{name}", "account.unmute_notifications": "להפסיק הסתרת הודעות ×ž×¢× @{name}", "account.view_full_profile": "הר××” ×ודות מל×ות", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "× ×™×ª×Ÿ להקיש {combo} כדי לדלג ×‘×¤×¢× ×”×‘××”", "bundle_column_error.body": "משהו השתבש בעת הצגת הרכיב ×”×–×”.", "bundle_column_error.retry": "×œ× ×¡×•×ª שוב", diff --git a/app/javascript/mastodon/locales/hr.json b/app/javascript/mastodon/locales/hr.json index 4b64d796dc2d11a3c2b0c7273b6f0b2c3ee32ff3..11cd1bff245249342ff571724a1e0d4593624fe9 100644 --- a/app/javascript/mastodon/locales/hr.json +++ b/app/javascript/mastodon/locales/hr.json @@ -28,6 +28,8 @@ "account.unmute": "PoniÅ¡ti utiÅ¡avanje @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "MožeÅ¡ pritisnuti {combo} kako bi ovo preskoÄio sljedeći put", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/hu.json b/app/javascript/mastodon/locales/hu.json index 79888e41e41eb57ab0cb9848064235662058da67..1ea65768a25de05430d386486e84beb6fc2e5103 100644 --- a/app/javascript/mastodon/locales/hu.json +++ b/app/javascript/mastodon/locales/hu.json @@ -28,6 +28,8 @@ "account.unmute": "@{name} kinémÃtása", "account.unmute_notifications": "@{name} értesÃtéseinek kinémÃtása", "account.view_full_profile": "Teljes profil megtekintése", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Megnyomhatod {combo}, hogy átugord következÅ‘ alkalommal", "bundle_column_error.body": "Hiba történt a komponens betöltése közben.", "bundle_column_error.retry": "Próbálja újra", diff --git a/app/javascript/mastodon/locales/hy.json b/app/javascript/mastodon/locales/hy.json index 932ff1565f9668abf473561a085f1cecaf962fbe..e9638bf96eb562bd222f4786f58419aa0b55bf56 100644 --- a/app/javascript/mastodon/locales/hy.json +++ b/app/javascript/mastodon/locales/hy.json @@ -28,6 +28,8 @@ "account.unmute": "Ô±ÕºÕ¡Õ¬Õ¼Õ¥ÖÕ¶Õ¥Õ¬ @{name}ÖŠÕ«Õ¶", "account.unmute_notifications": "Õ„Õ«Õ¡ÖÕ¶Õ¥Õ¬ Õ®Õ¡Õ¶Õ¸Ö‚ÖÕ¸Ö‚Õ´Õ¶Õ¥Ö€Õ¨ @{name}ÖŠÕ«Ö", "account.view_full_profile": "Ô´Õ«Õ¿Õ¥Õ¬ Õ¡Õ´Õ¢Õ¸Õ²Õ»Õ¡Õ¯Õ¡Õ¶ Õ¿Õ¡Ö€Õ¢Õ¥Ö€Õ¡Õ¯Õ¨Ö‰", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Ô¿Õ¡Ö€Õ¸Õ² Õ¥Õ½ Õ½Õ¥Õ²Õ´Õ¥Õ¬ {combo}Õ Õ½Õ¡ Õ°Õ¡Õ»Õ¸Ö€Õ¤ Õ¡Õ¶Õ£Õ¡Õ´ Õ¢Õ¡Ö Õ©Õ¸Õ²Õ¶Õ¥Õ¬Õ¸Ö‚ Õ°Õ¡Õ´Õ¡Ö€", "bundle_column_error.body": "Ô±ÕµÕ½ Õ¢Õ¡Õ²Õ¡Õ¤Ö€Õ«Õ¹Õ¨ Õ¢Õ¥Õ¼Õ¶Õ¥Õ¬Õ¸Ö‚ Õ¨Õ¶Õ©Õ¡ÖÖ„Õ¸Ö‚Õ´ Õ«Õ¶Õ¹ÖŠÕ¸Ö€ Õ¢Õ¡Õ¶ ÕÕ¡ÖƒÕ¡Õ¶Õ¾Õ¥ÖÖ‰", "bundle_column_error.retry": "Ô¿Ö€Õ¯Õ«Õ¶ ÖƒÕ¸Ö€Õ±Õ¥Õ¬", diff --git a/app/javascript/mastodon/locales/id.json b/app/javascript/mastodon/locales/id.json index bc4294679ec4be62288518c117df503034d23e48..c8d8ebe7680b6add5c8e489232958e1d1129672f 100644 --- a/app/javascript/mastodon/locales/id.json +++ b/app/javascript/mastodon/locales/id.json @@ -28,6 +28,8 @@ "account.unmute": "Berhenti membisukan @{name}", "account.unmute_notifications": "Munculkan notifikasi dari @{name}", "account.view_full_profile": "Lihat profil lengkap", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Anda dapat menekan {combo} untuk melewati ini", "bundle_column_error.body": "Kesalahan terjadi saat memuat komponen ini.", "bundle_column_error.retry": "Coba lagi", diff --git a/app/javascript/mastodon/locales/io.json b/app/javascript/mastodon/locales/io.json index 5ea982f466f4b3bf8b0ca686d1d2df2f14467a8c..a2e9af8ef1a0000e638a783c03c045ae7d216105 100644 --- a/app/javascript/mastodon/locales/io.json +++ b/app/javascript/mastodon/locales/io.json @@ -28,6 +28,8 @@ "account.unmute": "Ne plus celar @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Tu povas presar sur {combo} por omisar co en la venonta foyo", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/it.json b/app/javascript/mastodon/locales/it.json index 068598de2ec4c878e0190f7d4ccf1191fdafbd1f..40ea9b26de16b8c89666a29f1612a6b348bd0399 100644 --- a/app/javascript/mastodon/locales/it.json +++ b/app/javascript/mastodon/locales/it.json @@ -28,6 +28,8 @@ "account.unmute": "Non silenziare @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Puoi premere {combo} per saltare questo passaggio la prossima volta", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 0b88ac2df20454df55e8fc585417524c33581318..08f5e79629c71bd008e92990e41d26a950c76a9d 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -28,6 +28,8 @@ "account.unmute": "@{name}ã•ã‚“ã®ãƒŸãƒ¥ãƒ¼ãƒˆã‚’解除", "account.unmute_notifications": "@{name}ã•ã‚“ã‹ã‚‰ã®é€šçŸ¥ã‚’å—ã‘å–ã‚‹", "account.view_full_profile": "å…¨ã¦ã®æƒ…å ±ã‚’è¦‹ã‚‹", + "alert.unexpected.message": "ä¸æ˜Žãªã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ", + "alert.unexpected.title": "エラー", "boost_modal.combo": "次ã‹ã‚‰ã¯{combo}を押ã›ã°ã‚¹ã‚ップã§ãã¾ã™", "bundle_column_error.body": "コンãƒãƒ¼ãƒãƒ³ãƒˆã®èªã¿è¾¼ã¿ä¸ã«å•é¡ŒãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", "bundle_column_error.retry": "å†è©¦è¡Œ", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 532c1f04d0eaa046cd9ab6e2f2dcbc585b31e27a..bde4397f309b6c799b3419a644bbafba09f4bb7f 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -28,6 +28,8 @@ "account.unmute": "뮤트 í•´ì œ", "account.unmute_notifications": "@{name}ì˜ ì•Œë¦¼ 뮤트 í•´ì œ", "account.view_full_profile": "ì „ì²´ 프로필 보기", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "다ìŒë¶€í„° {combo}를 누르면 ì´ ê³¼ì •ì„ ê±´ë„ˆë›¸ 수 있습니다.", "bundle_column_error.body": "ì»´í¬ë„ŒíŠ¸ë¥¼ 불러오는 ê³¼ì •ì—ì„œ ë¬¸ì œê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤.", "bundle_column_error.retry": "다시 ì‹œë„", diff --git a/app/javascript/mastodon/locales/nl.json b/app/javascript/mastodon/locales/nl.json index a83971f00bf9872fe9e183a0cc39b5dfe5dc0f5f..140be0dca47aad904a65dc420f4a0ffce798c5ec 100644 --- a/app/javascript/mastodon/locales/nl.json +++ b/app/javascript/mastodon/locales/nl.json @@ -28,6 +28,8 @@ "account.unmute": "@{name} niet meer negeren", "account.unmute_notifications": "@{name} meldingen niet meer negeren", "account.view_full_profile": "Volledig profiel tonen", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Je kunt {combo} klikken om dit de volgende keer over te slaan", "bundle_column_error.body": "Tijdens het laden van dit onderdeel is er iets fout gegaan.", "bundle_column_error.retry": "Opnieuw proberen", diff --git a/app/javascript/mastodon/locales/no.json b/app/javascript/mastodon/locales/no.json index aaad033e29987781f93e8bfaef9c02bd7842c0a6..4d6ac133e364ba191fc3c106e561294c97e619e9 100644 --- a/app/javascript/mastodon/locales/no.json +++ b/app/javascript/mastodon/locales/no.json @@ -28,6 +28,8 @@ "account.unmute": "Avdemp @{name}", "account.unmute_notifications": "Vis varsler fra @{name}", "account.view_full_profile": "Vis hele profilen", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "You kan trykke {combo} for Ã¥ hoppe over dette neste gang", "bundle_column_error.body": "Noe gikk galt mens denne komponenten lastet.", "bundle_column_error.retry": "Prøv igjen", diff --git a/app/javascript/mastodon/locales/oc.json b/app/javascript/mastodon/locales/oc.json index f93fe29f6c76a370212b2aad49bc9c796bea2240..24dfa937535215646abe589765827e2b1f4db1a0 100644 --- a/app/javascript/mastodon/locales/oc.json +++ b/app/javascript/mastodon/locales/oc.json @@ -28,6 +28,8 @@ "account.unmute": "Quitar de rescondre @{name}", "account.unmute_notifications": "Mostrar las notificacions de @{name}", "account.view_full_profile": "Veire lo perfil complèt", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Podètz botar {combo} per passar aquò lo còp que ven", "bundle_column_error.body": "Quicòm a fach mèuca pendent lo cargament d’aqueste compausant.", "bundle_column_error.retry": "Tornar ensajar", diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index 8496495f5d395b264e52479edd01620e57c6fd84..0b6f178f8b6081d49162987c2ece91f3fc42c6f9 100644 --- a/app/javascript/mastodon/locales/pl.json +++ b/app/javascript/mastodon/locales/pl.json @@ -28,6 +28,8 @@ "account.unmute": "Cofnij wyciszenie @{name}", "account.unmute_notifications": "Cofnij wyciszenie powiadomieÅ„ od @{name}", "account.view_full_profile": "WyÅ›wietl peÅ‚ny profil", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "NaciÅ›nij {combo}, aby pominąć to nastÄ™pnym razem", "bundle_column_error.body": "CoÅ› poszÅ‚o nie tak podczas Å‚adowania tego skÅ‚adnika.", "bundle_column_error.retry": "Spróbuj ponownie", diff --git a/app/javascript/mastodon/locales/pt-BR.json b/app/javascript/mastodon/locales/pt-BR.json index c90fb37a04c7b8309bf001b91c9f22c60a76b8b7..dcaeaced9af67aab5918411ea6323551d940591c 100644 --- a/app/javascript/mastodon/locales/pt-BR.json +++ b/app/javascript/mastodon/locales/pt-BR.json @@ -28,6 +28,8 @@ "account.unmute": "Não silenciar @{name}", "account.unmute_notifications": "Retirar silêncio das notificações vindas de @{name}", "account.view_full_profile": "Ver perfil completo", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Você pode pressionar {combo} para ignorar este diálogo na próxima vez", "bundle_column_error.body": "Algo de errado aconteceu enquanto este componente era carregado.", "bundle_column_error.retry": "Tente novamente", diff --git a/app/javascript/mastodon/locales/pt.json b/app/javascript/mastodon/locales/pt.json index 3b20cf4e6b2213ad1165855ece3a9f6104b51348..4725a82da0460bf116177e5c225212fd30d9f360 100644 --- a/app/javascript/mastodon/locales/pt.json +++ b/app/javascript/mastodon/locales/pt.json @@ -28,6 +28,8 @@ "account.unmute": "Não silenciar @{name}", "account.unmute_notifications": "Deixar de silenciar @{name}", "account.view_full_profile": "Ver perfil completo", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Pode clicar {combo} para não voltar a ver", "bundle_column_error.body": "Algo de errado aconteceu enquanto este componente era carregado.", "bundle_column_error.retry": "Tente de novo", diff --git a/app/javascript/mastodon/locales/ru.json b/app/javascript/mastodon/locales/ru.json index ec21b5d5598d71e8591db2d4fc67b5d6f3be7980..8e7d36659b199b3e673636ea3c4121ff37c0d8cf 100644 --- a/app/javascript/mastodon/locales/ru.json +++ b/app/javascript/mastodon/locales/ru.json @@ -28,6 +28,8 @@ "account.unmute": "СнÑÑ‚ÑŒ глушение", "account.unmute_notifications": "Показывать ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾Ñ‚ @{name}", "account.view_full_profile": "Показать полный профиль", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Ðажмите {combo}, чтобы пропуÑтить Ñто в Ñледующий раз", "bundle_column_error.body": "Что-то пошло не так при загрузке Ñтого компонента.", "bundle_column_error.retry": "Попробовать Ñнова", diff --git a/app/javascript/mastodon/locales/sk.json b/app/javascript/mastodon/locales/sk.json index 683f2aadbd18648155f65ad6a38be32dec0ddbe8..e3b323943c8ecb7f46fb1e44ded7ec599d3c5d53 100644 --- a/app/javascript/mastodon/locales/sk.json +++ b/app/javascript/mastodon/locales/sk.json @@ -28,6 +28,8 @@ "account.unmute": "PrestaÅ¥ ignorovaÅ¥ @{name}", "account.unmute_notifications": "OdtĺmiÅ¥ notifikácie od @{name}", "account.view_full_profile": "Pozri celý profil", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Nabudúce môžete kliknúť {combo} aby ste preskoÄili", "bundle_column_error.body": "Nastala chyba pri naÄÃtanà tohto komponentu.", "bundle_column_error.retry": "Skúste znova", diff --git a/app/javascript/mastodon/locales/sr-Latn.json b/app/javascript/mastodon/locales/sr-Latn.json index c6512cda45912c5e76822d675449ef02e4b21036..d38e8e3af78b6628d973e9a718eb234754f070b3 100644 --- a/app/javascript/mastodon/locales/sr-Latn.json +++ b/app/javascript/mastodon/locales/sr-Latn.json @@ -28,6 +28,8 @@ "account.unmute": "Ukloni ućutkavanje korisniku @{name}", "account.unmute_notifications": "UkljuÄi nazad obaveÅ¡tenja od korisnika @{name}", "account.view_full_profile": "Vidi ceo profil", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Možete pritisnuti {combo} da preskoÄite ovo sledeći put", "bundle_column_error.body": "NeÅ¡to je poÅ¡lo po zlu prilikom uÄitavanja ove komponente.", "bundle_column_error.retry": "PokuÅ¡ajte ponovo", diff --git a/app/javascript/mastodon/locales/sr.json b/app/javascript/mastodon/locales/sr.json index 93fbe5960f1351ab48d8dcf63f3412265bd8dc21..3be0c89ee1583bd0e9674880da32d6cc222a68bd 100644 --- a/app/javascript/mastodon/locales/sr.json +++ b/app/javascript/mastodon/locales/sr.json @@ -28,6 +28,8 @@ "account.unmute": "Уклони ућуткавање кориÑнику @{name}", "account.unmute_notifications": "Укључи назад обавештења од кориÑника @{name}", "account.view_full_profile": "Види цео профил", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Можете притиÑнути {combo} да преÑкочите ово Ñледећи пут", "bundle_column_error.body": "Ðешто је пошло по злу приликом учитавања ове компоненте.", "bundle_column_error.retry": "Покушајте поново", diff --git a/app/javascript/mastodon/locales/sv.json b/app/javascript/mastodon/locales/sv.json index 4fa129173e1135ddd297bb8fed67b9ae7cc11b09..a13ba9847e727016a8687e2e0c01d8ad94b247ea 100644 --- a/app/javascript/mastodon/locales/sv.json +++ b/app/javascript/mastodon/locales/sv.json @@ -28,6 +28,8 @@ "account.unmute": "Ta bort tystad @{name}", "account.unmute_notifications": "Ã…teraktivera notifikationer frÃ¥n @{name}", "account.view_full_profile": "Visa hela profilen", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Du kan trycka {combo} för att slippa denna nästa gÃ¥ng", "bundle_column_error.body": "NÃ¥got gick fel när du laddade denna komponent.", "bundle_column_error.retry": "Försök igen", diff --git a/app/javascript/mastodon/locales/th.json b/app/javascript/mastodon/locales/th.json index 95a933b4061d51afb681bd835298873a1e27430b..59ff10b468a4dd44e39ed75f2568622de7bf3769 100644 --- a/app/javascript/mastodon/locales/th.json +++ b/app/javascript/mastodon/locales/th.json @@ -28,6 +28,8 @@ "account.unmute": "Unmute @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "You can press {combo} to skip this next time", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/tr.json b/app/javascript/mastodon/locales/tr.json index baaa5c97af03074879bf59bcad13ea82edcb9dc3..e83af319ec2abb33b08f0054f70ffd3385f34114 100644 --- a/app/javascript/mastodon/locales/tr.json +++ b/app/javascript/mastodon/locales/tr.json @@ -28,6 +28,8 @@ "account.unmute": "Sesi aç @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Bir dahaki sefere {combo} tuÅŸuna basabilirsiniz", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/uk.json b/app/javascript/mastodon/locales/uk.json index 1755c55b4d515693bb17f9ef8fa13628fdb39034..accc2d0277440edd8f28d3246ff8d0b74f75d69e 100644 --- a/app/javascript/mastodon/locales/uk.json +++ b/app/javascript/mastodon/locales/uk.json @@ -28,6 +28,8 @@ "account.unmute": "ЗнÑти глушеннÑ", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "Ви можете натиÑнути {combo}, щоб пропуÑтити це наÑтупного разу", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", diff --git a/app/javascript/mastodon/locales/zh-CN.json b/app/javascript/mastodon/locales/zh-CN.json index d031c85f3112f8017eb08a828148c6be50e14821..b9a912fb034169d7bfa19e636a38ccba2fa7b4fe 100644 --- a/app/javascript/mastodon/locales/zh-CN.json +++ b/app/javascript/mastodon/locales/zh-CN.json @@ -28,6 +28,8 @@ "account.unmute": "ä¸å†éšè— @{name}", "account.unmute_notifications": "ä¸å†éšè—æ¥è‡ª @{name} 的通知", "account.view_full_profile": "查看完整资料", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "ä¸‹æ¬¡æŒ‰ä½ {combo} å³å¯è·³è¿‡æ¤æ示", "bundle_column_error.body": "载入这个组件时å‘生了错误。", "bundle_column_error.retry": "é‡è¯•", diff --git a/app/javascript/mastodon/locales/zh-HK.json b/app/javascript/mastodon/locales/zh-HK.json index d3ad238ad2883e5a01c462f5c8dc45d43557f12a..91b1d00afb69df692dd2e01bc357c3f7263cc4d2 100644 --- a/app/javascript/mastodon/locales/zh-HK.json +++ b/app/javascript/mastodon/locales/zh-HK.json @@ -28,6 +28,8 @@ "account.unmute": "å–消 @{name} çš„éœéŸ³", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "查看完整資料", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "å¦‚ä½ æƒ³åœ¨ä¸‹æ¬¡è·¯éŽé€™é¡¯ç¤ºï¼Œè«‹æŒ‰{combo},", "bundle_column_error.body": "åŠ è¼‰æœ¬çµ„ä»¶å‡ºéŒ¯ã€‚", "bundle_column_error.retry": "é‡è©¦", diff --git a/app/javascript/mastodon/locales/zh-TW.json b/app/javascript/mastodon/locales/zh-TW.json index 3a5eade411b07c751a583c48a6af292999115f47..7e845c65082fc5ca08de470c8adb255c3317b899 100644 --- a/app/javascript/mastodon/locales/zh-TW.json +++ b/app/javascript/mastodon/locales/zh-TW.json @@ -28,6 +28,8 @@ "account.unmute": "ä¸å†æ¶ˆéŸ³ @{name}", "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "查看完整資訊", + "alert.unexpected.message": "An unexpected error occurred.", + "alert.unexpected.title": "Oops!", "boost_modal.combo": "ä¸‹æ¬¡ä½ å¯ä»¥æŒ‰ {combo} 來跳éŽ", "bundle_column_error.body": "åŠ è¼‰æœ¬çµ„ä»¶å‡ºéŒ¯ã€‚", "bundle_column_error.retry": "é‡è©¦", diff --git a/app/javascript/mastodon/middleware/errors.js b/app/javascript/mastodon/middleware/errors.js index b2c5f0898b459eb525cf9c3a1e861216f941643b..72e5631e6dae343154d59fd06d10501dace2d9c9 100644 --- a/app/javascript/mastodon/middleware/errors.js +++ b/app/javascript/mastodon/middleware/errors.js @@ -1,7 +1,13 @@ +import { defineMessages } from 'react-intl'; import { showAlert } from '../actions/alerts'; const defaultFailSuffix = 'FAIL'; +const messages = defineMessages({ + unexpectedTitle: { id: 'alert.unexpected.title', defaultMessage: 'Oops!' }, + unexpectedMessage: { id: 'alert.unexpected.message', defaultMessage: 'An unexpected error occurred.' }, +}); + export default function errorsMiddleware() { return ({ dispatch }) => next => action => { if (action.type && !action.skipAlert) { @@ -21,7 +27,7 @@ export default function errorsMiddleware() { dispatch(showAlert(title, message)); } else { console.error(action.error); - dispatch(showAlert('Oops!', 'An unexpected error occurred.')); + dispatch(showAlert(messages.unexpectedTitle, messages.unexpectedMessage)); } } }