Skip to content

Commit

Permalink
international encoding for remaining header/footer elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Knight committed Dec 17, 2018
1 parent 2bf05cb commit 2f0a628
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 30 deletions.
56 changes: 40 additions & 16 deletions components/Deck/ContentPanel/AttachSubdeck/AttachSlidesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ class AttachSubdeckModal extends React.Component{
this.handleNextButton = this.handleNextButton.bind(this);
this.handlePreviousButton = this.handlePreviousButton.bind(this);

this.messages = defineMessages({
attachText:{
id: 'attachSlidesModal.attachText',
defaultMessage: 'Attach Slides'
},
attach:{
id: 'attachSlidesModal.attach',
defaultMessage: 'Attach'
},
next:{
id: 'attachSlidesModal.next',
defaultMessage: 'Next'
},
previous:{
id: 'attachSlidesModal.previous',
defaultMessage: 'Previous'
},
cancel:{
id: 'attachSlidesModal.cancel',
defaultMessage: 'Cancel'
}

});

}

Expand Down Expand Up @@ -239,9 +262,9 @@ class AttachSubdeckModal extends React.Component{
}

actionButton = <Button id="nextAttachModal" color="green" icon tabIndex="0" type="button" aria-label="Next Select slides"
data-tooltip="Attach" disabled={this.state.selectedDeckId===-1} onClick={this.handleNextButton}>
data-tooltip={this.context.intl.formatMessage(this.messages.next)} disabled={this.state.selectedDeckId===-1} onClick={this.handleNextButton}>
<Icon name="arrow right"/>
Next
{this.context.intl.formatMessage(this.messages.next)}
<Icon name="arrow right"/>
</Button>;
actionButton2='';
Expand All @@ -253,45 +276,45 @@ class AttachSubdeckModal extends React.Component{
//<TextArea className="sr-only" id="attachSlidesDescription" value="Select slides to attach" tabIndex ='-1'/>;

segmentPanelContent = <AttachSlides numColumns="3" />;
actionButton = <Button id="attachAttachModal" color="green" icon tabIndex="0" type="button" aria-label="Attach"
data-tooltip="Attach" disabled={this.state.selectedSlides.length===0} onClick={this.handleAttachButton}>
actionButton = <Button id="attachAttachModal" color="green" icon tabIndex="0" type="button" aria-label={this.context.intl.formatMessage(this.messages.attach)}
data-tooltip={this.context.intl.formatMessage(this.messages.attach)} disabled={this.state.selectedSlides.length===0} onClick={this.handleAttachButton}>
<Icon name="attach"/>
Attach
{this.context.intl.formatMessage(this.messages.attach)}
<Icon name="attach"/>
</Button>;
actionButton2 =<Button id="previousAttachModal" color="green" icon tabIndex="0" type="button" aria-label="Previos"
data-tooltip="Previous" onClick={this.handlePreviousButton}>
actionButton2 =<Button id="previousAttachModal" color="green" icon tabIndex="0" type="button" aria-label={this.context.intl.formatMessage(this.messages.previous)}
data-tooltip={this.context.intl.formatMessage(this.messages.previous)} onClick={this.handlePreviousButton}>
<Icon name="arrow left"/>
Previous
{this.context.intl.formatMessage(this.messages.previous)}
<Icon name="arrow left"/>
</Button>;

}

let attachSlideBtn = <Popup trigger={<Button as="button" className={this.props.buttonStyle.classNames}
type="button" aria-label="Attach slides"
type="button" aria-label={this.context.intl.formatMessage(this.messages.attachText)}
aria-hidden={this.state.modalOpen}
basic onClick={this.handleOpen}
tabIndex={this.props.buttonStyle.noTabIndex ? -1 : 0}>
<Icon.Group size={this.props.buttonStyle.iconSize}>
<Icon className="grey" name="file alternate outline"/>
<Icon className="corner black" name="attach"/>
</Icon.Group>
</Button>} content='Attach slides' on='hover'/>;
</Button>} content={this.context.intl.formatMessage(this.messages.attachText)} on='hover'/>;


return (
<Modal trigger={attachSlideBtn}
open={this.state.modalOpen}
onClose={this.handleClose}
role="dialog"
id="attachSubDeckModal"
id="attachSlidesModal"
aria-labelledby="attachModalHeader"
aria-describedby="attachSlidesDescriptionSR"
aria-hidden = {!this.state.modalOpen}
tabIndex="0">
<FocusTrap
id="focus-trap-attachSubdeckModal"
id="focus-trap-attachSlidesModal"
focusTrapOptions={{
onDeactivate: this.unmountTrap,
clickOutsideDeactivates: true,
Expand All @@ -301,7 +324,7 @@ class AttachSubdeckModal extends React.Component{
className = "header">

<Modal.Header className="ui center aligned" as="h1" id="attachModalHeader">
Attach slides
{this.context.intl.formatMessage(this.messages.attachText)}
</Modal.Header>
<Modal.Content>
<Container text>
Expand All @@ -316,8 +339,8 @@ class AttachSubdeckModal extends React.Component{
<Modal.Actions>
{actionButton}
{actionButton2}
<Button id="cancelAttachModal" color="red" tabIndex="0" type="button" aria-label="Cancel" data-tooltip="Cancel" onClick={this.handleClose} >
Cancel
<Button id="cancelAttachModal" color="red" tabIndex="0" type="button" aria-label={this.context.intl.formatMessage(this.messages.cancel)} data-tooltip={this.context.intl.formatMessage(this.messages.cancel)} onClick={this.handleClose} >
{this.context.intl.formatMessage(this.messages.cancel)}
</Button>
</Modal.Actions>
</Segment>
Expand All @@ -334,7 +357,8 @@ class AttachSubdeckModal extends React.Component{


AttachSubdeckModal.contextTypes = {
executeAction: PropTypes.func.isRequired
executeAction: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired
};

AttachSubdeckModal = connectToStores(AttachSubdeckModal,[UserProfileStore,AttachSubdeckModalStore,DeckTreeStore],(context,props) => {
Expand Down
45 changes: 35 additions & 10 deletions components/Deck/ContentPanel/AttachSubdeck/AttachSubdeckModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@ class AttachSubdeckModal extends React.Component{
this.unmountTrap = this.unmountTrap.bind(this);
this.handleAttachButton = this.handleAttachButton.bind(this);

this.messages = defineMessages({
attachText:{
id: 'attachSubdeckModal.attachText',
defaultMessage: 'Attach Sub-deck'
},
attach:{
id: 'attachSubdeckModal.attach',
defaultMessage: 'Attach'
},
next:{
id: 'attachSubdeckModal.next',
defaultMessage: 'Next'
},
previous:{
id: 'attachSubdeckModal.previous',
defaultMessage: 'Previous'
},
cancel:{
id: 'attachSubdeckModal.cancel',
defaultMessage: 'Cancel'
}

});

}

componentWillReceiveProps(nextProps){
Expand Down Expand Up @@ -185,15 +209,15 @@ class AttachSubdeckModal extends React.Component{

let attachDeckBtn = <Popup trigger={<Button as="button" className={this.props.buttonStyle.classNames}
type="button"
aria-label="Attach sub-deck"
aria-label={this.context.intl.formatMessage(this.messages.attachText)}
aria-hidden={this.state.modalOpen}
basic icon onClick={this.handleOpen}
tabIndex={this.props.buttonStyle.noTabIndex?-1:0} >
<Icon.Group size={this.props.buttonStyle.iconSize}>
<Icon className="yellow" name="folder" />
<Icon className="corner" name="attach" />
</Icon.Group>
</Button>} content='Attach sub-deck' on='hover'/>;
</Button>} content={this.context.intl.formatMessage(this.messages.attachText)} on='hover'/>;

return (
<Modal trigger={attachDeckBtn}
Expand All @@ -216,7 +240,7 @@ class AttachSubdeckModal extends React.Component{
className = "header">

<Modal.Header className="ui center aligned" as="h1" id="attachSubdeckModalHeader">
Attach sub-deck
{this.context.intl.formatMessage(this.messages.attachText)}
</Modal.Header>
<Modal.Content>
<Container text>
Expand All @@ -229,14 +253,14 @@ class AttachSubdeckModal extends React.Component{
{segmentPanelContent}
</Segment>
<Modal.Actions>
<Button id="attachAttachDeckModal" color="green" icon tabIndex="0" type="button" aria-label="Attach"
data-tooltip="Attach" disabled={this.state.selectedDeckId===-1} onClick={this.handleAttachButton}>
<Button id="attachAttachDeckModal" color="green" icon tabIndex="0" type="button" aria-label={this.context.intl.formatMessage(this.messages.attach)}
data-tooltip={this.context.intl.formatMessage(this.messages.attach)} disabled={this.state.selectedDeckId===-1} onClick={this.handleAttachButton}>
<Icon name="attach"/>
{this.context.intl.formatMessage(this.messages.attach)}
<Icon name="attach"/>
Attach
<Icon name="attach"/>
</Button>
<Button id="cancelAttachModal" color="red" tabIndex="0" type="button" aria-label="Cancel" data-tooltip="Cancel" onClick={this.handleClose} >
Cancel
<Button id="cancelAttachModal" color="red" tabIndex="0" type="button" aria-label={this.context.intl.formatMessage(this.messages.cancel)} data-tooltip={this.context.intl.formatMessage(this.messages.cancel)} onClick={this.handleClose} >
{this.context.intl.formatMessage(this.messages.cancel)}
</Button>
</Modal.Actions>
</Segment>
Expand All @@ -253,7 +277,8 @@ class AttachSubdeckModal extends React.Component{


AttachSubdeckModal.contextTypes = {
executeAction: PropTypes.func.isRequired
executeAction: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired
};

AttachSubdeckModal = connectToStores(AttachSubdeckModal,[UserProfileStore,AttachSubdeckModalStore,DeckTreeStore],(context,props) => {
Expand Down
10 changes: 7 additions & 3 deletions components/Deck/ContentPanel/ContentActions/DownloadModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class DownloadModal extends React.Component{
downloadModal_HTML:{
id:'downloadModal.downloadModal_HTML',
defaultMessage: 'HTML (unzip and open index.html to access off-line presentation)'
},
downloadModal_button:{
id:'downloadModal.downloadModal_button',
defaultMessage:'Download'
}
});
}
Expand Down Expand Up @@ -167,12 +171,12 @@ class DownloadModal extends React.Component{

<Modal
trigger={ !this.props.textOnly ?
<Button icon aria-hidden="false" className="ui button" type="button" aria-label="Download" data-tooltip="Download" onClick={this.handleOpen} >
<Button icon aria-hidden="false" className="ui button" type="button" aria-label={this.context.intl.formatMessage(this.messages.downloadModal_button)} data-tooltip={this.context.intl.formatMessage(this.messages.downloadModal_button)} onClick={this.handleOpen} >
<Icon name='download' size='large'/>
</Button>
:
<div className={this.props.className} aria-label="Download" data-tooltip="Download" onClick={this.handleOpen}>
<span><Icon name='download' size='large'/> Download</span>
<div className={this.props.className} aria-label={this.context.intl.formatMessage(this.messages.downloadModal_button)} data-tooltip={this.context.intl.formatMessage(this.messages.downloadModal_button)} onClick={this.handleOpen}>
<span><Icon name='download' size='large'/> {this.context.intl.formatMessage(this.messages.downloadModal_button)}</span>
</div>
}

Expand Down
6 changes: 5 additions & 1 deletion components/Deck/ContentPanel/ContentActions/EmbedModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class EmbedModal extends React.Component {
id:'embedModal.other',
defaultMessage: 'Other'
},
buttonText:{
id:'embedModal.buttonText',
defaultMessage: 'Embed'
}
});
}

Expand Down Expand Up @@ -183,7 +187,7 @@ class EmbedModal extends React.Component {
return(
<Modal
trigger={
<div className="item" data-value="Embed" role="menuitem" aria-label="Embed" data-tooltip="Embed" tabIndex="0" onClick={this.handleEmbed.bind(this)} onKeyPress={this.handleKeyPress.bind(this)}>
<div className="item" data-value="Embed" role="menuitem" aria-label={this.context.intl.formatMessage(this.messages.buttonText)} data-tooltip={this.context.intl.formatMessage(this.messages.buttonText)} tabIndex="0" onClick={this.handleEmbed.bind(this)} onKeyPress={this.handleKeyPress.bind(this)}>
<div role="button" className="SocialMediaShareButton Demo__some-network__share-button">
<div style={{width: this.props.size + 'px', height: this.props.size + 'px', fontSize: this.props.fontSize + 'px'}}>
<Icon name="share square" style={{
Expand Down
12 changes: 12 additions & 0 deletions intl/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,18 @@
"TagsPanel.aria.cancel": "Cancel tags",
"TagsPanel.TagInput.placeholder": "Insert new tags",
"editpanel.handleAddQuestionsClick": "Add questions",
"attachSlidesModal.attachText": "Attach Slides",
"attachSlidesModal.attach": "Attach",
"attachSlidesModal.next": "Next",
"attachSlidesModal.previous": "Previous",
"attachSlidesModal.cancel": "Cancel",
"slidesModal.attachSlidesDescriptionStep1": "You can attach one or more slides from another deck. First select your deck containing the slides or search SlideWiki for a deck. We advise a maximum of 50 slides per (sub)deck for maximal performance/speed for viewing your presentation. You can also separate a large presentation, for example, a series of lectures, into a deck collection.",
"slidesModal.attachSlidesDescriptionStep2": "Select slides to attach. We advise a maximum of 50 slides per (sub)deck for maximal performance/speed for viewing your presentation. You can also separate a large presentation, for example, a series of lectures, into a deck collection.",
"attachSubdeckModal.attachText": "Attach Sub-deck",
"attachSubdeckModal.attach": "Attach",
"attachSubdeckModal.next": "Next",
"attachSubdeckModal.previous": "Previous",
"attachSubdeckModal.cancel": "Cancel",
"subDeckModal.attachSubdeckModalDescription": "Select a deck to attach from your My Decks list or search SlideWiki. We recommend that decks have a maximum of 50 slides per (sub)deck for optimum performance when viewing your presentation. If you wish to collate lots of decks then we recommend creating a playlist.",
"ContentActionsFooter.followButtonText": "Subscribe to this deck",
"ContentActionsFooter.followButtonTextAlternate": "You are subscribed to this deck, click to unsubscribe",
Expand Down Expand Up @@ -549,6 +559,7 @@
"downloadModal.downloadModal_downloadButton": "Download",
"downloadModal.downloadModal_cancelButton": "Cancel",
"downloadModal.downloadModal_HTML": "HTML (unzip and open index.html to access off-line presentation)",
"downloadModal.downloadModal_button": "Download",
"embedModal.closeButton": "Close",
"embedModal.deckRadio": "Deck",
"embedModal.slideshowRadio": "Slideshow",
Expand All @@ -557,6 +568,7 @@
"embedModal.medium": "Medium",
"embedModal.large": "Large",
"embedModal.other": "Other",
"embedModal.buttonText": "Embed",
"embedModal.embedHeader": "Embed SlideWiki deck \"{title}\"",
"embedModal.description": "Use the options to select how this deck will be displayed. Then copy the generated code into your site.",
"embedModal.embed": "Embed:",
Expand Down

0 comments on commit 2f0a628

Please sign in to comment.