Translated error messages

This commit is contained in:
Przemek Wiech
2020-09-12 20:04:42 +02:00
parent a886230305
commit 13b147f082
9 changed files with 68 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ import {
WikiTreeDataSource,
WikiTreeSourceSpec,
} from './datasource/wikitree';
import {getI18nMessage} from './util/error_i18n';
/** Shows an error message in the middle of the screen. */
function ErrorMessage(props: {message?: string}) {
@@ -330,7 +331,7 @@ export class App extends React.Component<RouteComponentProps, {}> {
}),
);
} catch (error) {
this.setError(error.message);
this.setError(getI18nMessage(error, this.context.intl));
}
} else if (
this.state.state === AppState.SHOWING_CHART ||