diff --git a/imports/startup/client/i18n.js b/imports/startup/client/i18n.js
index 57186b2..ebafcf7 100644
--- a/imports/startup/client/i18n.js
+++ b/imports/startup/client/i18n.js
@@ -2,6 +2,7 @@
import i18n from 'i18next';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
+import { ReactiveVar } from 'meteor/reactive-var';
import backend from 'i18next-xhr-backend';
import LngDetector from 'i18next-browser-languagedetector';
import Cache from 'i18next-localstorage-cache';
@@ -28,6 +29,8 @@ const detectorOptions = {
excludeCacheFor: ['cimode'] // languages to not persist (cookie, localStorage)
};
+export const i18nReady = new ReactiveVar(false);
+
const cacheOptions = {
// turn on or off
enabled: false,
@@ -68,6 +71,7 @@ i18n.use(backend)
console.error(err);
return;
}
+ i18nReady.set(true);
document.title = t('AppName');
// Accounts translation
// https://github.com/softwarerero/meteor-accounts-t9n
@@ -86,7 +90,7 @@ i18n.use(backend)
showLink: false,
position: 'bottom',
linkText: 'Lee más',
- linkRouteName: '/',
+ linkRouteName: '/privacy',
acceptButtonText: 'Aceptar',
html: false,
expirationInDays: 70,
diff --git a/imports/ui/layouts/App/App.js b/imports/ui/layouts/App/App.js
index 7a18592..9b49053 100644
--- a/imports/ui/layouts/App/App.js
+++ b/imports/ui/layouts/App/App.js
@@ -12,7 +12,7 @@ import { Roles } from 'meteor/alanning:roles';
// https://github.com/gadicc/meteor-blaze-react-component/
import Blaze from 'meteor/gadicc:blaze-react-component';
// i18n
-import i18n from '/imports/startup/client/i18n';
+import i18n, { i18nReady } from '/imports/startup/client/i18n';
import '/imports/startup/client/ravenLogger';
import '/imports/startup/client/geolocation';
import '/imports/startup/client/piwik-start.js';
@@ -88,8 +88,9 @@ const App = props => (
+ {props.i18nReady.get() &&
- {/* */}
+ }
: ''}
@@ -102,6 +103,7 @@ App.defaultProps = {
App.propTypes = {
loading: PropTypes.bool.isRequired,
+ i18nReady: PropTypes.object.isRequired,
userId: PropTypes.string,
emailAddress: PropTypes.string,
emailVerified: PropTypes.bool.isRequired
@@ -119,10 +121,11 @@ export default withTracker(() => {
const loading = !Roles.subscription.ready();
const name = user && user.profile && user.profile.name && getUserName(user.profile.name);
const emailAddress = user && user.emails && user.emails[0].address;
-
+ console.log(`i18n ready?: ${i18nReady.get()}`);
return {
loading,
loggingIn,
+ i18nReady,
authenticated: !loggingIn && !!userId,
name: name || emailAddress,
roles: !loading && Roles.getRolesForUser(userId),