mirror of https://github.com/Sonarr/Sonarr
Fixed: Translating static strings
This commit is contained in:
parent
c1f8c7b17b
commit
ef6ff370ba
|
@ -11,8 +11,15 @@ function getTranslations() {
|
||||||
let translations = {};
|
let translations = {};
|
||||||
|
|
||||||
export function fetchTranslations() {
|
export function fetchTranslations() {
|
||||||
return getTranslations().then((data) => {
|
return new Promise(async(resolve) => {
|
||||||
|
try {
|
||||||
|
const data = await getTranslations();
|
||||||
translations = data.strings;
|
translations = data.strings;
|
||||||
|
|
||||||
|
resolve(true);
|
||||||
|
} catch (error) {
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import createAppStore from 'Store/createAppStore';
|
import createAppStore from 'Store/createAppStore';
|
||||||
import { fetchTranslations } from 'Utilities/String/translate';
|
import { fetchTranslations } from 'Utilities/String/translate';
|
||||||
import App from './App/App';
|
|
||||||
|
|
||||||
|
// import App from './App/App';
|
||||||
import './preload';
|
import './preload';
|
||||||
import './polyfills';
|
import './polyfills';
|
||||||
import 'Diag/ConsoleApi';
|
import 'Diag/ConsoleApi';
|
||||||
|
@ -13,14 +13,8 @@ import './index.css';
|
||||||
|
|
||||||
const history = createBrowserHistory();
|
const history = createBrowserHistory();
|
||||||
const store = createAppStore(history);
|
const store = createAppStore(history);
|
||||||
let hasTranslationsError = false;
|
const hasTranslationsError = !await fetchTranslations();
|
||||||
|
const { default: App } = await import('./App/App');
|
||||||
try {
|
|
||||||
await fetchTranslations();
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
hasTranslationsError = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<App
|
<App
|
||||||
|
|
Loading…
Reference in New Issue