Include y18n without creating files + fix modal

This commit is contained in:
Mayesters 2017-06-03 13:27:37 +02:00
parent 4e86023bf1
commit a539b58829
2 changed files with 8 additions and 6 deletions

View file

@ -3,7 +3,8 @@ import lbry from './lbry.js';
const env = ENV;
const config = require(`./config/${env}`);
const i18n = require('y18n')
const language = lbry.getClientSetting('language') ? lbry.getClientSetting('language') : 'en';
const i18n = require('y18n')({directory: 'app/locales', updateFiles: false, locale: language});
const logs = [];
const app = {
env: env,

View file

@ -1,6 +1,7 @@
import React from 'react';
import ReactModal from 'react-modal';
import Link from 'component/link';
import app from '../app.js'
export class Modal extends React.Component {
static propTypes = {
@ -17,8 +18,8 @@ export class Modal extends React.Component {
static defaultProps = {
type: 'alert',
overlay: true,
confirmButtonLabel: __('OK'),
abortButtonLabel: __('Cancel'),
confirmButtonLabel: app.i18n.__('OK'),
abortButtonLabel: app.i18n.__('Cancel'),
confirmButtonDisabled: false,
abortButtonDisabled: false,
}
@ -51,9 +52,9 @@ export class ExpandableModal extends React.Component {
}
static defaultProps = {
confirmButtonLabel: __('OK'),
expandButtonLabel: __('Show More...'),
hideButtonLabel: __('Show Less'),
confirmButtonLabel: app.i18n.__('OK'),
expandButtonLabel: app.i18n.__('Show More...'),
hideButtonLabel: app.i18n.__('Show Less'),
}
constructor(props) {