diff --git a/js/components/ascribe_accordion_list/accordion_list.js b/js/components/ascribe_accordion_list/accordion_list.js index 597581db..a1a1c88a 100644 --- a/js/components/ascribe_accordion_list/accordion_list.js +++ b/js/components/ascribe_accordion_list/accordion_list.js @@ -1,6 +1,8 @@ 'use strict'; import React from 'react'; +import { getLangText } from '../../utils/lang_utils'; + let AccordionList = React.createClass({ propTypes: { @@ -20,8 +22,8 @@ let AccordionList = React.createClass({ } else if(this.props.count === 0) { return (
-

We could not find any works related to you...

-

To register one, click here!

+

{getLangText('We could not find any works related to you%s', '...')}

+

{getLangText('To register one, click')} {getLangText('here')}!

); } else { @@ -34,4 +36,4 @@ let AccordionList = React.createClass({ } }); -export default AccordionList; \ No newline at end of file +export default AccordionList; diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 16832779..e9ab9aeb 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -29,7 +29,7 @@ let AccordionListItem = React.createClass({ if (this.props.content.requestAction){ return ( You have actions pending in one of your editions}> + overlay={{getLangText('You have actions pending in one of your editions')}}> ); } diff --git a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js index 2bb3bd52..1f83d218 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js @@ -146,10 +146,10 @@ let AccordionListItemTableEditions = React.createClass({ new ColumnModel( (item) => { return { - 'content': item.edition_number + ' of ' + item.num_editions + 'content': item.edition_number + ' ' + getLangText('of') + ' ' + item.num_editions }; }, 'edition_number', - 'Edition', + getLangText('Edition'), TableItemText, 1, false, @@ -172,6 +172,7 @@ let AccordionListItemTableEditions = React.createClass({ (item) => { let content = item.acl; if (item.request_action){ + // TODO should request be translated? content = [item.request_action + ' request']; } return { @@ -193,7 +194,7 @@ let AccordionListItemTableEditions = React.createClass({ Hide editions : Show editions {show && typeof editionsForPiece === 'undefined' ? loadingSpinner : null}} /> + message={show && typeof editionsForPiece !== 'undefined' ? {getLangText('Hide editions')} : {getLangText('Show editions')} {show && typeof editionsForPiece === 'undefined' ? loadingSpinner : null}} /> , handleSuccess: this.showNotification }; } if (this.props.action === 'unconsign'){ return { - title: 'Unconsign artwork', - tooltip: 'Have the owner manage his sales again', + title: getLangText('Unconsign artwork'), + tooltip: getLangText('Have the owner manage his sales again'), form: , handleSuccess: this.showNotification }; }else if (this.props.action === 'transfer') { return { - title: 'Transfer artwork', - tooltip: 'Transfer the ownership of the artwork', + title: getLangText('Transfer artwork'), + tooltip: getLangText('Transfer the ownership of the artwork'), form: , handleSuccess: this.showNotification }; } else if (this.props.action === 'loan'){ return { - title: 'Loan artwork', - tooltip: 'Loan your artwork for a limited period of time', + title: getLangText('Loan artwork'), + tooltip: getLangText('Loan your artwork for a limited period of time'), form: , handleSuccess: this.showNotification }; } else if (this.props.action === 'share'){ return { - title: 'Share artwork', - tooltip: 'Share the artwork', + title: getLangText('Share artwork'), + tooltip: getLangText('Share the artwork'), form: , handleSuccess: this.showNotification }; @@ -75,6 +78,7 @@ let AclButton = React.createClass({ return ( {this.props.action.toUpperCase()} diff --git a/js/components/ascribe_buttons/button_submit_close.js b/js/components/ascribe_buttons/button_submit_close.js index 8b054116..11d3c0a4 100644 --- a/js/components/ascribe_buttons/button_submit_close.js +++ b/js/components/ascribe_buttons/button_submit_close.js @@ -3,6 +3,7 @@ import React from 'react'; import AppConstants from '../../constants/application_constants'; +import { getLangText } from '../../utils/lang_utils.js' let ButtonSubmitOrClose = React.createClass({ propTypes: { @@ -22,7 +23,7 @@ let ButtonSubmitOrClose = React.createClass({ return (
- +
); } diff --git a/js/components/ascribe_buttons/delete_button.js b/js/components/ascribe_buttons/delete_button.js index 37f3d862..0c9ef154 100644 --- a/js/components/ascribe_buttons/delete_button.js +++ b/js/components/ascribe_buttons/delete_button.js @@ -13,6 +13,7 @@ import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; import { getAvailableAcls } from '../../utils/acl_utils'; +import { getLangText } from '../../utils/lang_utils.js' import EditionListActions from '../../actions/edition_list_actions'; @@ -42,11 +43,11 @@ let DeleteButton = React.createClass({ if (availableAcls.indexOf('delete') > -1) { content = ; - btnDelete = ; + btnDelete = ; } else if (availableAcls.indexOf('del_from_collection') > -1){ content = ; - btnDelete = ; + btnDelete = ; } else{ return null; @@ -55,8 +56,8 @@ let DeleteButton = React.createClass({ + title={getLangText('Remove Edition')} + tooltip={getLangText('Click to remove edition')}> { content } ); diff --git a/js/components/ascribe_collapsible/collapsible_paragraph.js b/js/components/ascribe_collapsible/collapsible_paragraph.js index 4c3a779f..d133b2f1 100644 --- a/js/components/ascribe_collapsible/collapsible_paragraph.js +++ b/js/components/ascribe_collapsible/collapsible_paragraph.js @@ -6,6 +6,8 @@ import CollapsibleMixin from 'react-bootstrap/lib/CollapsibleMixin'; import classNames from 'classnames'; +import { getLangText } from '../../utils/lang_utils.js' + const CollapsibleParagraph = React.createClass({ @@ -41,7 +43,7 @@ const CollapsibleParagraph = React.createClass({ render() { let styles = this.getCollapsibleClassSet(); - let text = this.isExpanded() ? '[hide]' : '[show]'; + let text = this.isExpanded() ? '[' + getLangText('hide') + ']' : '[' + getLangText('show') + ']'; if(this.props.show) { return (
diff --git a/js/components/ascribe_forms/form_consign.js b/js/components/ascribe_forms/form_consign.js index 42f909a8..d2db267d 100644 --- a/js/components/ascribe_forms/form_consign.js +++ b/js/components/ascribe_forms/form_consign.js @@ -7,6 +7,7 @@ import FormMixin from '../../mixins/form_mixin'; import InputText from './input_text'; import InputTextArea from './input_textarea'; import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; +import { getLangText } from '../../utils/lang_utils.js' let ConsignForm = React.createClass({ mixins: [FormMixin], @@ -29,12 +30,12 @@ let ConsignForm = React.createClass({ let title = this.getTitlesString().join(''); let username = this.props.currentUser.username; let message = -`Hi, +`${getLangText('Hi')}, -I consign : -${title}to you. +${getLangText('I consign')} : +${title}${getLangText('to you')}. -Truly yours, +${getLangText('Truly yours')}, ${username}`; return ( @@ -43,7 +44,7 @@ ${username}`; @@ -54,12 +55,12 @@ ${username}`; /> diff --git a/js/components/ascribe_forms/form_delete_edition.js b/js/components/ascribe_forms/form_delete_edition.js index 40d21a7f..d0aa5970 100644 --- a/js/components/ascribe_forms/form_delete_edition.js +++ b/js/components/ascribe_forms/form_delete_edition.js @@ -5,6 +5,7 @@ import React from 'react'; import requests from '../../utils/requests'; import ApiUrls from '../../constants/api_urls'; import FormMixin from '../../mixins/form_mixin'; +import { getLangText } from '../../utils/lang_utils'; let EditionDeleteForm = React.createClass({ @@ -20,11 +21,11 @@ let EditionDeleteForm = React.createClass({ renderForm () { return (
-

Are you sure you would like to permanently delete this edition?

-

This is an irrevocable action.

+

{getLangText('Are you sure you would like to permanently delete this edition')}?

+

{getLangText('This is an irrevocable action%s', '.')}

- - + +
); diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index ae4ca49e..b003650a 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -13,6 +13,8 @@ import InputTextArea from './input_textarea'; import OwnershipFetcher from '../../fetchers/ownership_fetcher'; import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; +import { getLangText } from '../../utils/lang_utils.js' + let LoanForm = React.createClass({ getInitialState() { @@ -74,20 +76,20 @@ let LoanForm = React.createClass({ let title = this.getTitlesString().join(''); let username = this.props.currentUser.username; let message = -`Hi, +`${getLangText('Hi')}, -I loan : -${title}to you. +${getLangText('I loan')} : +${title}${getLangText('to you')}. -Truly yours, +${getLangText('Truly yours')}, ${username}`; let contract = ; if (this.state.loaneeHasContract){ let label = (); contract = ( @@ -118,12 +120,12 @@ ${username}`;
+ placeholderText={getLangText('Loan start date')} />
+ placeholderText={getLangText('Loan end date')} />
{contract} diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index 1a4f2672..3402ba4c 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -9,6 +9,7 @@ import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; import SignupModal from '../ascribe_modal/modal_signup'; import PasswordResetRequestModal from '../ascribe_modal/modal_password_request_reset'; +import { getLangText } from '../../utils/lang_utils.js' let LoginForm = React.createClass({ mixins: [FormMixin], @@ -31,28 +32,28 @@ let LoginForm = React.createClass({
- Forgot your password? + {getLangText('Forgot your password')}? Reset password}/> + button={ {getLangText('Reset password')}}/>
- Not a member yet? + {getLangText('Not a member yet')}? Sign up}/> + button={ {getLangText('Sign up')}}/>
@@ -60,4 +61,4 @@ let LoginForm = React.createClass({ } }); -export default LoginForm; \ No newline at end of file +export default LoginForm; diff --git a/js/components/ascribe_forms/form_password_reset.js b/js/components/ascribe_forms/form_password_reset.js index 60e9b077..e42689a4 100644 --- a/js/components/ascribe_forms/form_password_reset.js +++ b/js/components/ascribe_forms/form_password_reset.js @@ -6,6 +6,7 @@ import apiUrls from '../../constants/api_urls'; import FormMixin from '../../mixins/form_mixin'; import InputText from './input_text'; import ButtonSubmit from '../ascribe_buttons/button_submit'; +import { getLangText } from '../../utils/lang_utils.js' let PasswordResetForm = React.createClass({ mixins: [FormMixin], @@ -29,18 +30,18 @@ let PasswordResetForm = React.createClass({
Reset the password for {this.props.email}:
); diff --git a/js/components/ascribe_forms/form_password_reset_request.js b/js/components/ascribe_forms/form_password_reset_request.js index f61e8b05..7e5ac62b 100644 --- a/js/components/ascribe_forms/form_password_reset_request.js +++ b/js/components/ascribe_forms/form_password_reset_request.js @@ -6,6 +6,7 @@ import apiUrls from '../../constants/api_urls'; import FormMixin from '../../mixins/form_mixin'; import InputText from './input_text'; import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; +import { getLangText } from '../../utils/lang_utils.js' let PasswordResetRequestForm = React.createClass({ mixins: [FormMixin], @@ -25,12 +26,12 @@ let PasswordResetRequestForm = React.createClass({
@@ -38,4 +39,4 @@ let PasswordResetRequestForm = React.createClass({ } }); -export default PasswordResetRequestForm; \ No newline at end of file +export default PasswordResetRequestForm; diff --git a/js/components/ascribe_forms/form_piece_extradata.js b/js/components/ascribe_forms/form_piece_extradata.js index c2cebeb5..6d6ffc56 100644 --- a/js/components/ascribe_forms/form_piece_extradata.js +++ b/js/components/ascribe_forms/form_piece_extradata.js @@ -3,6 +3,7 @@ import React from 'react'; import requests from '../../utils/requests'; +import { getLangText } from '../../utils/lang_utils.js' import apiUrls from '../../constants/api_urls'; @@ -46,7 +47,7 @@ let PieceExtraDataForm = React.createClass({ rows={3} editable={this.props.editable} defaultValue={defaultValue} - placeholder={'Fill in ' + this.props.title} + placeholder={getLangText('Fill in%s', ' ') + this.props.title} required/>