diff --git a/ui/js/app.js b/ui/js/app.js index 987b112c8..2f94dc302 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -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, diff --git a/ui/js/component/modal.js b/ui/js/component/modal.js index 8ee2a54ca..ee01e8432 100644 --- a/ui/js/component/modal.js +++ b/ui/js/component/modal.js @@ -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) {