fixed styles

This commit is contained in:
Wyatt Johnson
2018-01-17 13:41:02 -07:00
parent 3938b7883f
commit c612902779
2 changed files with 11 additions and 11 deletions
+1 -5
View File
@@ -5,7 +5,7 @@ import EventEmitter from 'eventemitter2';
import { createReduxEmitter } from './events';
import { createRestClient } from './rest';
import thunk from 'redux-thunk';
import { setupTranslations, loadTranslations } from './i18n';
import { loadTranslations } from './i18n';
import bowser from 'bowser';
import noop from 'lodash/noop';
import { BASE_PATH } from 'coral-framework/constants/url';
@@ -88,10 +88,6 @@ export async function createContext({
const pymStorage = createPymStorage(pym);
const history = createHistory(BASE_PATH);
const introspection = createIntrospection(introspectionData);
// Setup the translation framework with the storage.
setupTranslations(storage);
let store = null;
const token = () => {
// Try to get the token from localStorage. If it isn't here, it may
+10 -6
View File
@@ -3,14 +3,14 @@ import has from 'lodash/has';
import get from 'lodash/get';
import merge from 'lodash/merge';
import { createStorage } from 'coral-framework/services/storage';
import moment from 'moment';
import 'moment/locale/da';
import 'moment/locale/es';
import 'moment/locale/fr';
import 'moment/locale/pt-br';
import { createStorage } from 'coral-framework/services/storage';
import daTA from 'timeago.js/locales/da';
import esTA from 'timeago.js/locales/es';
import frTA from 'timeago.js/locales/fr';
@@ -52,20 +52,21 @@ function setLocale(storage, locale) {
function getLocale(storage) {
try {
const locale = (
return (
(storage && storage.getItem('locale')) ||
navigator.language ||
defaultLanguage
).split('-')[0];
return locale;
} catch (err) {
console.error(err);
return null;
}
}
export function setupTranslations(storage) {
export function setupTranslations() {
// Setup the translation framework with the storage.
const storage = createStorage();
const locale = getLocale(storage);
setLocale(storage, locale);
@@ -124,3 +125,6 @@ export function t(key, ...replacements) {
}
export default t;
// Setup the translations globally as soon as this module runs.
setupTranslations();