filaActions and fileCard components translated

This commit is contained in:
Intnick 2017-05-26 09:02:37 +02:00
parent a000058bf6
commit 0119ed8edc
3 changed files with 51 additions and 26 deletions

View file

@ -192,5 +192,31 @@
"submit an issue on GitHub": "submit an issue on GitHub", "submit an issue on GitHub": "submit an issue on GitHub",
"Bug report submitted": "Bug report submitted", "Bug report submitted": "Bug report submitted",
"Your bug report has been submitted! Thank you for your feedback.": "Your bug report has been submitted! Thank you for your feedback.", "Your bug report has been submitted! Thank you for your feedback.": "Your bug report has been submitted! Thank you for your feedback.",
"Balance": "Balance" "Balance": "Balance",
} "Open in Folder": "Open in Folder",
"Checking availability": "Checking availability",
"Confirm Purchase": "Confirm Purchase",
"This will purchase": "This will purchase",
"for": "for",
"credits": "credits",
"Not enough credits": "Not enough credits",
"You don't have enough LBRY credits to pay for this stream.": "You don't have enough LBRY credits to pay for this stream.",
"Download failed": "Download failed",
"LBRY was unable to download the stream": "LBRY was unable to download the stream",
"Remove": "Remove",
"Are you sure you'd like to remove": "Are you sure you'd like to remove",
"from LBRY?": "from LBRY?",
"Delete this file from my computer": "Delete this file from my computer",
"Download": "Download",
"Content unavailable.": "Content unavailable.",
"Why?": "Why?",
"The content on LBRY is hosted by its users. It appears there are no users connected that have this file at the moment.": "The content on LBRY is hosted by its users. It appears there are no users connected that have this file at the moment.",
"Try Anyway": "Try Anyway",
"Open": "Open",
"Remove...": "Remove...",
"% complete": "% complete",
"Loading...": "Loading...",
"Empty claim or metadata info.": "Empty claim or metadata info.",
"This content is Not Safe For Work. To view adult content, please change your": "This content is Not Safe For Work. To view adult content, please change your",
"This address contains no content.": "This address contains no content."
}

View file

@ -66,7 +66,7 @@ class FileActions extends React.Component {
const deleteChecked = this.state.deleteChecked, const deleteChecked = this.state.deleteChecked,
metadata = fileInfo ? fileInfo.metadata : null, metadata = fileInfo ? fileInfo.metadata : null,
openInFolderMessage = platform.startsWith('Mac') ? 'Open in Finder' : 'Open in Folder', openInFolderMessage = platform.startsWith('Mac') ? __('Open in Finder') : __('Open in Folder'),
showMenu = fileInfo && Object.keys(fileInfo).length > 0, showMenu = fileInfo && Object.keys(fileInfo).length > 0,
title = metadata ? metadata.title : uri; title = metadata ? metadata.title : uri;
@ -76,7 +76,7 @@ class FileActions extends React.Component {
const const
progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0, progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
label = fileInfo ? progress.toFixed(0) + '% complete' : 'Connecting...', label = fileInfo ? progress.toFixed(0) + __('% complete') : __('Connecting...'),
labelWithIcon = <span className="button__content"><Icon icon="icon-download" /><span>{label}</span></span>; labelWithIcon = <span className="button__content"><Icon icon="icon-download" /><span>{label}</span></span>;
content = <div className="faux-button-block file-actions__download-status-bar button-set-item"> content = <div className="faux-button-block file-actions__download-status-bar button-set-item">
@ -86,24 +86,24 @@ class FileActions extends React.Component {
} else if (!fileInfo && isAvailable === undefined) { } else if (!fileInfo && isAvailable === undefined) {
content = <BusyMessage message="Checking availability" /> content = <BusyMessage message={__("Checking availability")} />
} else if (!fileInfo && !isAvailable && !this.state.forceShowActions) { } else if (!fileInfo && !isAvailable && !this.state.forceShowActions) {
content = <div> content = <div>
<div className="button-set-item empty">Content unavailable.</div> <div className="button-set-item empty">{__("Content unavailable.")}</div>
<ToolTip label="Why?" <ToolTip label={__("Why?")}
body="The content on LBRY is hosted by its users. It appears there are no users connected that have this file at the moment." body={__("The content on LBRY is hosted by its users. It appears there are no users connected that have this file at the moment.")}
className="button-set-item" /> className="button-set-item" />
<Link label="Try Anyway" onClick={this.onShowFileActionsRowClicked.bind(this)} className="button-text button-set-item" /> <Link label={__("Try Anyway")} onClick={this.onShowFileActionsRowClicked.bind(this)} className="button-text button-set-item" />
</div> </div>
} else if (fileInfo === null && !downloading) { } else if (fileInfo === null && !downloading) {
content = <Link button="text" label="Download" icon="icon-download" onClick={() => { startDownload(uri) } } />; content = <Link button="text" label={__("Download")} icon="icon-download" onClick={() => { startDownload(uri) } } />;
} else if (fileInfo && fileInfo.download_path) { } else if (fileInfo && fileInfo.download_path) {
content = <Link label="Open" button="text" icon="icon-folder-open" onClick={() => openInShell(fileInfo)} />; content = <Link label={__("Open")} button="text" icon="icon-folder-open" onClick={() => openInShell(fileInfo)} />;
} else { } else {
console.log('handle this case of file action props?'); console.log('handle this case of file action props?');
console.log(this.props) console.log(this.props)
@ -115,29 +115,29 @@ class FileActions extends React.Component {
{ showMenu ? { showMenu ?
<DropDownMenu> <DropDownMenu>
<DropDownMenuItem key={0} onClick={() => openInFolder(fileInfo)} label={openInFolderMessage} /> <DropDownMenuItem key={0} onClick={() => openInFolder(fileInfo)} label={openInFolderMessage} />
<DropDownMenuItem key={1} onClick={() => openModal('confirmRemove')} label="Remove..." /> <DropDownMenuItem key={1} onClick={() => openModal('confirmRemove')} label={__("Remove...")} />
</DropDownMenu> : '' } </DropDownMenu> : '' }
<Modal type="confirm" isOpen={modal == 'affirmPurchase'} <Modal type="confirm" isOpen={modal == 'affirmPurchase'}
contentLabel="Confirm Purchase" onConfirmed={this.onAffirmPurchase.bind(this)} onAborted={this.props.closeModal}> contentLabel={__("Confirm Purchase")} onConfirmed={this.onAffirmPurchase.bind(this)} onAborted={this.props.closeModal}>
This will purchase <strong>{title}</strong> for <strong><FilePrice uri={uri} look="plain" /></strong> credits. {__("This will purchase")} <strong>{title}</strong> {__("for")} <strong><FilePrice uri={uri} look="plain" /></strong> {__("credits")}.
</Modal> </Modal>
<Modal isOpen={modal == 'notEnoughCredits'} contentLabel="Not enough credits" <Modal isOpen={modal == 'notEnoughCredits'} contentLabel={__("Not enough credits")}
onConfirmed={closeModal}> onConfirmed={closeModal}>
You don't have enough LBRY credits to pay for this stream. {__("You don't have enough LBRY credits to pay for this stream.")}
</Modal> </Modal>
<Modal isOpen={modal == 'timedOut'} contentLabel="Download failed" <Modal isOpen={modal == 'timedOut'} contentLabel={__("Download failed")}
onConfirmed={closeModal}> onConfirmed={closeModal}>
LBRY was unable to download the stream <strong>{uri}</strong>. {__("LBRY was unable to download the stream")} <strong>{uri}</strong>.
</Modal> </Modal>
<Modal isOpen={modal == 'confirmRemove'} <Modal isOpen={modal == 'confirmRemove'}
contentLabel="Not enough credits" contentLabel={__("Not enough credits")}
type="confirm" type="confirm"
confirmButtonLabel="Remove" confirmButtonLabel={__("Remove")}
onConfirmed={() => deleteFile(fileInfo.outpoint, deleteChecked)} onConfirmed={() => deleteFile(fileInfo.outpoint, deleteChecked)}
onAborted={closeModal}> onAborted={closeModal}>
<p>Are you sure you'd like to remove <cite>{title}</cite> from LBRY?</p> <p>{__("Are you sure you'd like to remove")} <cite>{title}</cite> {__("from LBRY?")}</p>
<label><FormField type="checkbox" checked={deleteChecked} onClick={this.handleDeleteCheckboxClicked.bind(this)} /> Delete this file from my computer</label> <label><FormField type="checkbox" checked={deleteChecked} onClick={this.handleDeleteCheckboxClicked.bind(this)} /> {__("Delete this file from my computer")}</label>
</Modal> </Modal>
</section> </section>
); );

View file

@ -68,11 +68,11 @@ class FileCard extends React.Component {
let description = "" let description = ""
if (isResolvingUri) { if (isResolvingUri) {
description = "Loading..." description = __("Loading...")
} else if (metadata && metadata.description) { } else if (metadata && metadata.description) {
description = metadata.description description = metadata.description
} else if (claim === null) { } else if (claim === null) {
description = 'This address contains no content.' description = __("This address contains no content.")
} }
return ( return (
@ -99,8 +99,7 @@ class FileCard extends React.Component {
{obscureNsfw && this.state.hovered {obscureNsfw && this.state.hovered
? <div className='card-overlay'> ? <div className='card-overlay'>
<p> <p>
This content is Not Safe For Work. {__("This content is Not Safe For Work. To view adult content, please change your")} <Link className="button-text" onClick={() => navigate('settings')} label={__("Settings")} />.
To view adult content, please change your <Link className="button-text" onClick={() => navigate('settings')} label="Settings" />.
</p> </p>
</div> </div>
: null} : null}