diff options
author | =Corey Hulen <corey@hulen.com> | 2016-02-27 08:19:03 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-02-27 08:19:03 -0800 |
commit | 6c18e13f8ae4d8785b598adc0cb3e93c27cec849 (patch) | |
tree | 8143e2fff5173f46c1fe5cf655e7347f395b836c /web/react/utils | |
parent | 5a1ca435c9e4fe667159b76d8a0961188529d0f9 (diff) | |
download | chat-6c18e13f8ae4d8785b598adc0cb3e93c27cec849.tar.gz chat-6c18e13f8ae4d8785b598adc0cb3e93c27cec849.tar.bz2 chat-6c18e13f8ae4d8785b598adc0cb3e93c27cec849.zip |
Adding missing localization
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/client.jsx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 2d0377e72..f647e2296 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -4,6 +4,15 @@ import BrowserStore from '../stores/browser_store.jsx'; import TeamStore from '../stores/team_store.jsx'; import ErrorStore from '../stores/error_store.jsx'; +let translations = { + connectionError: 'There appears to be a problem with your internet connection.', + unknownError: 'We received an unexpected status code from the server.' +}; + +export function setTranslations(messages) { + translations = messages; +} + export function track(category, action, label, property, value) { global.window.analytics.track(action, {category, label, property, value}); } @@ -23,14 +32,14 @@ function handleError(methodName, xhr, status, err) { var msg = ''; if (e) { - msg = 'error in ' + methodName + ' msg=' + e.message + ' detail=' + e.detailed_error + ' rid=' + e.request_id; + msg = 'method=' + methodName + ' msg=' + e.message + ' detail=' + e.detailed_error + ' rid=' + e.request_id; } else { - msg = 'error in ' + methodName + ' status=' + status + ' statusCode=' + xhr.status + ' err=' + err; + msg = 'method=' + methodName + ' status=' + status + ' statusCode=' + xhr.status + ' err=' + err; if (xhr.status === 0) { - e = {message: 'There appears to be a problem with your internet connection'}; + e = {message: translations.connectionError}; } else { - e = {message: 'We received an unexpected status code from the server (' + xhr.status + ')'}; + e = {message: translations.unknownError + ' (' + xhr.status + ')'}; } } |