moved the import of y18n component before some other imports; translations for auth developer
This commit is contained in:
parent
df2192116c
commit
8917d9e7e7
19 changed files with 200 additions and 127 deletions
|
@ -75,5 +75,73 @@
|
||||||
"Discover": "Discover",
|
"Discover": "Discover",
|
||||||
"Fetching content": "Fetching content",
|
"Fetching content": "Fetching content",
|
||||||
"What's this?": "What's this?",
|
"What's this?": "What's this?",
|
||||||
"Community Content is a public space where anyone can share content with the rest of the LBRY community. Bid on the names \"one,\" \"two,\" \"three,\" \"four\" and \"five\" to put your content here!": "Community Content is a public space where anyone can share content with the rest of the LBRY community. Bid on the names \"one,\" \"two,\" \"three,\" \"four\" and \"five\" to put your content here!"
|
"Community Content is a public space where anyone can share content with the rest of the LBRY community. Bid on the names \"one,\" \"two,\" \"three,\" \"four\" and \"five\" to put your content here!": "Community Content is a public space where anyone can share content with the rest of the LBRY community. Bid on the names \"one,\" \"two,\" \"three,\" \"four\" and \"five\" to put your content here!",
|
||||||
|
"LBRY is Closed": "LBRY is Closed",
|
||||||
|
"Click here to start LBRY": "Click here to start LBRY",
|
||||||
|
"Failed to load landing content.": "Failed to load landing content.",
|
||||||
|
"Settings": "Settings",
|
||||||
|
"Welcome to LBRY": "Welcome to LBRY",
|
||||||
|
"Downloads & Purchases": "Downloads & Purchases",
|
||||||
|
"Downloaded": "Downloaded",
|
||||||
|
"Published": "Published",
|
||||||
|
"Publishes": "Publishes",
|
||||||
|
"Overview": "Overview",
|
||||||
|
"Send": "Send",
|
||||||
|
"Receive": "Receive",
|
||||||
|
"Rewards": "Rewards",
|
||||||
|
"Search results for %s": "Search results for %s",
|
||||||
|
"Search": "Search",
|
||||||
|
"Your email is still not verified.": "Your email is still not verified.",
|
||||||
|
"Next": "Next",
|
||||||
|
"Email": "Email",
|
||||||
|
"Verification Code": "Verification Code",
|
||||||
|
"A verification code is required to access this version.": "A verification code is required to access this version.",
|
||||||
|
"Verify": "Verify",
|
||||||
|
"No code?": "No code?",
|
||||||
|
"Click here": "Click here",
|
||||||
|
"Authentication": "Authentication",
|
||||||
|
"LBRY Early Access": "LBRY Early Access",
|
||||||
|
"Preparing for first access": "Preparing for first access",
|
||||||
|
"Welcome to LBRY.": "Welcome to LBRY.",
|
||||||
|
"Using LBRY is like dating a centaur. Totally normal up top, and <em>way different</em> underneath.": "Using LBRY is like dating a centaur. Totally normal up top, and <em>way different</em> underneath.",
|
||||||
|
"Up top, LBRY is similar to popular media sites.": "Up top, LBRY is similar to popular media sites.",
|
||||||
|
"Below, LBRY is controlled by users -- you -- via blockchain and decentralization.": "Below, LBRY is controlled by users -- you -- via blockchain and decentralization.",
|
||||||
|
"Thank you for making content freedom possible! Here's a nickel, kid.": "Thank you for making content freedom possible! Here's a nickel, kid.",
|
||||||
|
"Developer Settings": "Developer Settings",
|
||||||
|
"Show developer menu": "Show developer menu",
|
||||||
|
"Use custom search servers": "Use custom search servers",
|
||||||
|
"Custom search servers (one per line)": "Custom search servers (one per line)",
|
||||||
|
"Force Upgrade": "Force Upgrade",
|
||||||
|
"OK": "OK",
|
||||||
|
"Show More...": "Show More...",
|
||||||
|
"Show Less": "Show Less",
|
||||||
|
"Starting daemon": "Starting daemon",
|
||||||
|
"Waiting for name resolution": "Waiting for name resolution",
|
||||||
|
"Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.": "Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.",
|
||||||
|
"Claim Reward": "Claim Reward",
|
||||||
|
"Claiming...": "Claiming...",
|
||||||
|
"This is an estimate and does not include data fees": "This is an estimate and does not include data fees",
|
||||||
|
"free": "free",
|
||||||
|
"Reward Claim Error": "Reward Claim Error",
|
||||||
|
"This field is required": "This field is required",
|
||||||
|
"Choose File": "Choose File",
|
||||||
|
"No File Chosen": "No File Chosen",
|
||||||
|
"Choose Directory": "Choose Directory",
|
||||||
|
"Downloading Update": "Downloading Update",
|
||||||
|
"Click \"Begin Upgrade\" to start the upgrade process.": "Click \"Begin Upgrade\" to start the upgrade process.",
|
||||||
|
"The app will close, and you will be prompted to install the latest version of LBRY.": "The app will close, and you will be prompted to install the latest version of LBRY.",
|
||||||
|
"After the install is complete, please reopen the app.": "After the install is complete, please reopen the app.",
|
||||||
|
"Begin Upgrade": "Begin Upgrade",
|
||||||
|
"API connection string": "API connection string",
|
||||||
|
"We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.": "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.",
|
||||||
|
"You haven't downloaded anything from LBRY yet. Go": "You haven't downloaded anything from LBRY yet. Go",
|
||||||
|
"search for your first download": "search for your first download",
|
||||||
|
"Loading": "Loading",
|
||||||
|
" credits": " credits",
|
||||||
|
"It looks like you haven't published anything to LBRY yet. Go": "It looks like you haven't published anything to LBRY yet. Go",
|
||||||
|
"share your beautiful cats with the world": "share your beautiful cats with the world",
|
||||||
|
"report": "report",
|
||||||
|
"Content-Type": "Content-Type",
|
||||||
|
"Author": "Author",
|
||||||
|
"License": "License"
|
||||||
}
|
}
|
|
@ -55,11 +55,11 @@ class SubmitEmailStage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<form onSubmit={(event) => { this.handleSubmit(event) }}>
|
<form onSubmit={(event) => { this.handleSubmit(event) }}>
|
||||||
<FormRow ref={(ref) => { this._emailRow = ref }} type="text" label="Email" placeholder="scrwvwls@lbry.io"
|
<FormRow ref={(ref) => { this._emailRow = ref }} type="text" label={__("Email")} placeholder="scrwvwls@lbry.io"
|
||||||
name="email" value={this.state.email}
|
name="email" value={this.state.email}
|
||||||
onChange={(event) => { this.handleEmailChanged(event) }} />
|
onChange={(event) => { this.handleEmailChanged(event) }} />
|
||||||
<div className="form-row-submit">
|
<div className="form-row-submit">
|
||||||
<Link button="primary" label="Next" disabled={this.state.submitting} onClick={(event) => { this.handleSubmit(event) }} />
|
<Link button="primary" label={__("Next")} disabled={this.state.submitting} onClick={(event) => { this.handleSubmit(event) }} />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
@ -102,7 +102,7 @@ class ConfirmEmailStage extends React.Component {
|
||||||
if (userEmail.is_verified) {
|
if (userEmail.is_verified) {
|
||||||
this.props.setStage("welcome")
|
this.props.setStage("welcome")
|
||||||
} else {
|
} else {
|
||||||
onSubmitError(new Error("Your email is still not verified.")) //shouldn't happen?
|
onSubmitError(new Error(__("Your email is still not verified."))) //shouldn't happen?
|
||||||
}
|
}
|
||||||
}, onSubmitError);
|
}, onSubmitError);
|
||||||
}
|
}
|
||||||
|
@ -111,14 +111,14 @@ class ConfirmEmailStage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<form onSubmit={(event) => { this.handleSubmit(event) }}>
|
<form onSubmit={(event) => { this.handleSubmit(event) }}>
|
||||||
<FormRow label="Verification Code" ref={(ref) => { this._codeRow = ref }} type="text"
|
<FormRow label={__("Verification Code")} ref={(ref) => { this._codeRow = ref }} type="text"
|
||||||
name="code" placeholder="a94bXXXXXXXXXXXXXX" value={this.state.code} onChange={(event) => { this.handleCodeChanged(event) }}
|
name="code" placeholder="a94bXXXXXXXXXXXXXX" value={this.state.code} onChange={(event) => { this.handleCodeChanged(event) }}
|
||||||
helper="A verification code is required to access this version."/>
|
helper={__("A verification code is required to access this version.")}/>
|
||||||
<div className="form-row-submit form-row-submit--with-footer">
|
<div className="form-row-submit form-row-submit--with-footer">
|
||||||
<Link button="primary" label="Verify" disabled={this.state.submitting} onClick={(event) => { this.handleSubmit(event)}} />
|
<Link button="primary" label={__("Verify")} disabled={this.state.submitting} onClick={(event) => { this.handleSubmit(event)}} />
|
||||||
</div>
|
</div>
|
||||||
<div className="form-field__helper">
|
<div className="form-field__helper">
|
||||||
No code? <Link onClick={() => { this.props.setStage("nocode")}} label="Click here" />.
|
{__("No code?")} <Link onClick={() => { this.props.setStage("nocode")}} label={__("Click here")} />.
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
@ -150,26 +150,26 @@ class WelcomeStage extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
!this.state.hasReward ?
|
!this.state.hasReward ?
|
||||||
<Modal type="custom" isOpen={true} contentLabel="Welcome to LBRY" {...this.props}>
|
<Modal type="custom" isOpen={true} contentLabel={__("Welcome to LBRY")} {...this.props}>
|
||||||
<section>
|
<section>
|
||||||
<h3 className="modal__header">Welcome to LBRY.</h3>
|
<h3 className="modal__header">{__("Welcome to LBRY.")}</h3>
|
||||||
<p>Using LBRY is like dating a centaur. Totally normal up top, and <em>way different</em> underneath.</p>
|
<p>{__("Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.")}</p>
|
||||||
<p>Up top, LBRY is similar to popular media sites.</p>
|
<p>{__("Up top, LBRY is similar to popular media sites.")}</p>
|
||||||
<p>Below, LBRY is controlled by users -- you -- via blockchain and decentralization.</p>
|
<p>{__("Below, LBRY is controlled by users -- you -- via blockchain and decentralization.")}</p>
|
||||||
<p>Thank you for making content freedom possible! Here's a nickel, kid.</p>
|
<p>{__("Thank you for making content freedom possible! Here's a nickel, kid.")}</p>
|
||||||
<div style={{textAlign: "center", marginBottom: "12px"}}>
|
<div style={{textAlign: "center", marginBottom: "12px"}}>
|
||||||
<RewardLink type="new_user" button="primary" onRewardClaim={(event) => { this.onRewardClaim(event) }} onRewardFailure={() => this.props.setStage(null)} onConfirmed={() => { this.props.setStage(null) }} />
|
<RewardLink type="new_user" button="primary" onRewardClaim={(event) => { this.onRewardClaim(event) }} onRewardFailure={() => this.props.setStage(null)} onConfirmed={() => { this.props.setStage(null) }} />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</Modal> :
|
</Modal> :
|
||||||
<Modal type="alert" overlayClassName="modal-overlay modal-overlay--clear" isOpen={true} contentLabel="Welcome to LBRY" {...this.props} onConfirmed={() => { this.props.setStage(null) }}>
|
<Modal type="alert" overlayClassName="modal-overlay modal-overlay--clear" isOpen={true} contentLabel={__("Welcome to LBRY")} {...this.props} onConfirmed={() => { this.props.setStage(null) }}>
|
||||||
<section>
|
<section>
|
||||||
<h3 className="modal__header">About Your Reward</h3>
|
<h3 className="modal__header">{__("About Your Reward")}</h3>
|
||||||
<p>You earned a reward of <CreditAmount amount={this.state.rewardAmount} label={false} /> LBRY credits, or <em>LBC</em>.</p>
|
<p>{__("You earned a reward of ")} <CreditAmount amount={this.state.rewardAmount} label={false} /> {__("LBRY credits, or \"LBC\".")}</p>
|
||||||
<p>This reward will show in your Wallet momentarily, probably while you are reading this message.</p>
|
<p>{__("This reward will show in your Wallet momentarily, probably while you are reading this message.")}</p>
|
||||||
<p>LBC is used to compensate creators, to publish, and to have say in how the network works.</p>
|
<p>{__("LBC is used to compensate creators, to publish, and to have say in how the network works.")}</p>
|
||||||
<p>No need to understand it all just yet! Try watching or downloading something next.</p>
|
<p>{__("No need to understand it all just yet! Try watching or downloading something next.")}</p>
|
||||||
<p>Finally, know that LBRY is an early beta and that it earns the name.</p>
|
<p>{__("Finally, know that LBRY is an early beta and that it earns the name.")}</p>
|
||||||
</section>
|
</section>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
@ -178,16 +178,16 @@ class WelcomeStage extends React.Component {
|
||||||
|
|
||||||
const ErrorStage = (props) => {
|
const ErrorStage = (props) => {
|
||||||
return <section>
|
return <section>
|
||||||
<p>An error was encountered that we cannot continue from.</p>
|
<p>{__("An error was encountered that we cannot continue from.")}</p>
|
||||||
<p>At least we're earning the name beta.</p>
|
<p>{__("At least we're earning the name beta.")}</p>
|
||||||
{ props.errorText ? <p>Message: {props.errorText}</p> : '' }
|
{ props.errorText ? <p>{__("Message:")} {props.errorText}</p> : '' }
|
||||||
<Link button="alt" label="Try Reload" onClick={() => { window.location.reload() } } />
|
<Link button="alt" label={__("Try Reload")} onClick={() => { window.location.reload() } } />
|
||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
|
|
||||||
const PendingStage = (props) => {
|
const PendingStage = (props) => {
|
||||||
return <section>
|
return <section>
|
||||||
<p>Preparing for first access <span className="busy-indicator"></span></p>
|
<p>{__("Preparing for first access")} <span className="busy-indicator"></span></p>
|
||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,20 +230,20 @@ class CodeRequiredStage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<section className="section-spaced">
|
<section className="section-spaced">
|
||||||
<p>Access to LBRY is restricted as we build and scale the network.</p>
|
<p>{__("Access to LBRY is restricted as we build and scale the network.")}</p>
|
||||||
<p>There are two ways in:</p>
|
<p>{__("There are two ways in:")}</p>
|
||||||
<h3>Own LBRY Credits</h3>
|
<h3>{__("Own LBRY Credits")}</h3>
|
||||||
<p>If you own at least 1 LBC, you can get in right now.</p>
|
<p>{__("If you own at least 1 LBC, you can get in right now.")}</p>
|
||||||
<p style={{ textAlign: "center"}}><Link onClick={() => { setLocal('auth_bypassed', true); this.props.setStage(null); }}
|
<p style={{ textAlign: "center"}}><Link onClick={() => { setLocal('auth_bypassed', true); this.props.setStage(null); }}
|
||||||
disabled={disabled} label="Let Me In" button={ disabled ? "alt" : "primary" } /></p>
|
disabled={disabled} label={__("Let Me In")} button={ disabled ? "alt" : "primary" } /></p>
|
||||||
<p>Your balance is <CreditAmount amount={this.state.balance} />. To increase your balance, send credits to this address:</p>
|
<p>{__("Your balance is ")}<CreditAmount amount={this.state.balance} />. {__("To increase your balance, send credits to this address:")}</p>
|
||||||
<p><Address address={ this.state.address ? this.state.address : "Generating Address..." } /></p>
|
<p><Address address={ this.state.address ? this.state.address : __("Generating Address...") } /></p>
|
||||||
<p>If you don't understand how to send credits, then...</p>
|
<p>{__("If you don't understand how to send credits, then...")}</p>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h3>Wait For A Code</h3>
|
<h3>{__("Wait For A Code")}</h3>
|
||||||
<p>If you provide your email, you'll automatically receive a notification when the system is open.</p>
|
<p>{__("If you provide your email, you'll automatically receive a notification when the system is open.")}</p>
|
||||||
<p><Link onClick={() => { this.props.setStage("email"); }} label="Return" /></p>
|
<p><Link onClick={() => { this.props.setStage("email"); }} label={__("Return")} /></p>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -312,16 +312,16 @@ export class AuthOverlay extends React.Component {
|
||||||
const StageContent = this._stages[this.state.stage];
|
const StageContent = this._stages[this.state.stage];
|
||||||
|
|
||||||
if (!StageContent) {
|
if (!StageContent) {
|
||||||
return <span className="empty">Unknown authentication step.</span>
|
return <span className="empty">{__("Unknown authentication step.")}</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.state.stage != "welcome" ?
|
this.state.stage != "welcome" ?
|
||||||
<ModalPage className="modal-page--full" isOpen={true} contentLabel="Authentication">
|
<ModalPage className="modal-page--full" isOpen={true} contentLabel={__("Authentication")}>
|
||||||
<h1>LBRY Early Access</h1>
|
<h1>{__("LBRY Early Access")}</h1>
|
||||||
<StageContent {...this.state.stageProps} setStage={(stage, stageProps) => { this.setStage(stage, stageProps) }} />
|
<StageContent {...this.state.stageProps} setStage={(stage, stageProps) => { this.setStage(stage, stageProps) }} />
|
||||||
</ModalPage> :
|
</ModalPage> :
|
||||||
<StageContent setStage={(stage, stageProps) => { this.setStage(stage, stageProps) }} {...this.state.stageProps} />
|
<StageContent setStage={(stage, stageProps) => { this.setStage(stage, stageProps) }} {...this.state.stageProps} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,9 @@ export class CreditAmount extends React.Component {
|
||||||
const formattedAmount = lbry.formatCredits(this.props.amount, this.props.precision);
|
const formattedAmount = lbry.formatCredits(this.props.amount, this.props.precision);
|
||||||
let amountText;
|
let amountText;
|
||||||
if (this.props.showFree && parseFloat(formattedAmount) == 0) {
|
if (this.props.showFree && parseFloat(formattedAmount) == 0) {
|
||||||
amountText = 'free';
|
amountText = __('free');
|
||||||
} else if (this.props.label) {
|
} else if (this.props.label) {
|
||||||
amountText = formattedAmount + (parseFloat(formattedAmount) == 1 ? ' credit' : ' credits');
|
amountText = formattedAmount + (parseFloat(formattedAmount) == 1 ? __(' credit') : __(' credits'));
|
||||||
} else {
|
} else {
|
||||||
amountText = formattedAmount;
|
amountText = formattedAmount;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ export class CreditAmount extends React.Component {
|
||||||
<span>
|
<span>
|
||||||
{amountText}
|
{amountText}
|
||||||
</span>
|
</span>
|
||||||
{ this.props.isEstimate ? <span className="credit-amount__estimate" title="This is an estimate and does not include data fees">*</span> : null }
|
{ this.props.isEstimate ? <span className="credit-amount__estimate" title={__("This is an estimate and does not include data fees")}>*</span> : null }
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,22 +15,22 @@ class DownloadingModal extends React.Component {
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isOpen={true} contentLabel="Downloading Update" type="custom">
|
<Modal isOpen={true} contentLabel={__("Downloading Update")} type="custom">
|
||||||
Downloading Update{downloadProgress ? `: ${downloadProgress}%` : null}
|
{__("Downloading Update")}{downloadProgress ? `: ${downloadProgress}%` : null}
|
||||||
<Line percent={downloadProgress} strokeWidth="4"/>
|
<Line percent={downloadProgress} strokeWidth="4"/>
|
||||||
{downloadComplete ? (
|
{downloadComplete ? (
|
||||||
<div>
|
<div>
|
||||||
<br />
|
<br />
|
||||||
<p>Click "Begin Upgrade" to start the upgrade process.</p>
|
<p>{__("Click \"Begin Upgrade\" to start the upgrade process.")}</p>
|
||||||
<p>The app will close, and you will be prompted to install the latest version of LBRY.</p>
|
<p>{__("The app will close, and you will be prompted to install the latest version of LBRY.")}</p>
|
||||||
<p>After the install is complete, please reopen the app.</p>
|
<p>{__("After the install is complete, please reopen the app.")}</p>
|
||||||
</div>
|
</div>
|
||||||
) : null }
|
) : null }
|
||||||
<div className="modal__buttons">
|
<div className="modal__buttons">
|
||||||
{downloadComplete
|
{downloadComplete
|
||||||
? <Link button="primary" label="Begin Upgrade" className="modal__button" onClick={startUpgrade} />
|
? <Link button="primary" label={__("Begin Upgrade")} className="modal__button" onClick={startUpgrade} />
|
||||||
: null}
|
: null}
|
||||||
<Link button="alt" label="Cancel" className="modal__button" onClick={cancelUpgrade} />
|
<Link button="alt" label={__("Cancel")} className="modal__button" onClick={cancelUpgrade} />
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,12 +15,12 @@ class ErrorModal extends React.Component {
|
||||||
const errorObj = typeof error === "string" ? { error: error } : error
|
const errorObj = typeof error === "string" ? { error: error } : error
|
||||||
|
|
||||||
const error_key_labels = {
|
const error_key_labels = {
|
||||||
connectionString: 'API connection string',
|
connectionString: __('API connection string'),
|
||||||
method: 'Method',
|
method: __('Method'),
|
||||||
params: 'Parameters',
|
params: __('Parameters'),
|
||||||
code: 'Error code',
|
code: __('Error code'),
|
||||||
message: 'Error message',
|
message: __('Error message'),
|
||||||
data: 'Error data',
|
data: __('Error data'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,16 +35,16 @@ class ErrorModal extends React.Component {
|
||||||
return(
|
return(
|
||||||
<ExpandableModal
|
<ExpandableModal
|
||||||
isOpen={modal == 'error'}
|
isOpen={modal == 'error'}
|
||||||
contentLabel="Error" className="error-modal"
|
contentLabel={__("Error")} className="error-modal"
|
||||||
overlayClassName="error-modal-overlay"
|
overlayClassName="error-modal-overlay"
|
||||||
onConfirmed={closeModal}
|
onConfirmed={closeModal}
|
||||||
extraContent={errorInfo}
|
extraContent={errorInfo}
|
||||||
>
|
>
|
||||||
<h3 className="modal__header">Error</h3>
|
<h3 className="modal__header">{__("Error")}</h3>
|
||||||
|
|
||||||
<div className="error-modal__content">
|
<div className="error-modal__content">
|
||||||
<div><img className="error-modal__warning-symbol" src={lbry.imagePath('warning.png')} /></div>
|
<div><img className="error-modal__warning-symbol" src={lbry.imagePath('warning.png')} /></div>
|
||||||
<p>We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.</p>
|
<p>{__("We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.")}</p>
|
||||||
</div>
|
</div>
|
||||||
</ExpandableModal>
|
</ExpandableModal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -41,14 +41,14 @@ class FileSelector extends React.Component {
|
||||||
<div className="file-selector">
|
<div className="file-selector">
|
||||||
<button type="button" className="file-selector__choose-button" onClick={() => this.handleButtonClick()}>
|
<button type="button" className="file-selector__choose-button" onClick={() => this.handleButtonClick()}>
|
||||||
{this.props.type == 'file' ?
|
{this.props.type == 'file' ?
|
||||||
'Choose File' :
|
__('Choose File') :
|
||||||
'Choose Directory'}
|
__('Choose Directory')}
|
||||||
</button>
|
</button>
|
||||||
{' '}
|
{' '}
|
||||||
<span className="file-selector__path">
|
<span className="file-selector__path">
|
||||||
{this.state.path ?
|
{this.state.path ?
|
||||||
this.state.path :
|
this.state.path :
|
||||||
'No File Chosen'}
|
__('No File Chosen')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class FormField extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this._fieldRequiredText = 'This field is required';
|
this._fieldRequiredText = __('This field is required');
|
||||||
this._type = null;
|
this._type = null;
|
||||||
this._element = null;
|
this._element = null;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ export class FormRow extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this._fieldRequiredText = 'This field is required';
|
this._fieldRequiredText = __('This field is required');
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
isError: false,
|
isError: false,
|
||||||
|
|
|
@ -2,6 +2,9 @@ import React from 'react';
|
||||||
import ReactModal from 'react-modal';
|
import ReactModal from 'react-modal';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
|
|
||||||
|
const i18n = require('y18n')({directory: 'app/locales'});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export class Modal extends React.Component {
|
export class Modal extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -18,8 +21,8 @@ export class Modal extends React.Component {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
overlay: true,
|
overlay: true,
|
||||||
confirmButtonLabel: 'OK',
|
confirmButtonLabel: i18n.__('OK'),
|
||||||
abortButtonLabel: 'Cancel',
|
abortButtonLabel: i18n.__('Cancel'),
|
||||||
confirmButtonDisabled: false,
|
confirmButtonDisabled: false,
|
||||||
abortButtonDisabled: false,
|
abortButtonDisabled: false,
|
||||||
}
|
}
|
||||||
|
@ -52,9 +55,9 @@ export class ExpandableModal extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
confirmButtonLabel: 'OK',
|
confirmButtonLabel: i18n.__('OK'),
|
||||||
expandButtonLabel: 'Show More...',
|
expandButtonLabel: i18n.__('Show More...'),
|
||||||
hideButtonLabel: 'Show Less',
|
hideButtonLabel: i18n.__('Show Less'),
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -77,15 +77,15 @@ export class RewardLink extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div className="reward-link">
|
<div className="reward-link">
|
||||||
{this.props.claimed
|
{this.props.claimed
|
||||||
? <span><Icon icon="icon-check" /> Reward claimed.</span>
|
? <span><Icon icon="icon-check" /> {__("Reward claimed.")}</span>
|
||||||
: <Link button={this.props.button ? this.props.button : 'alt'} disabled={this.state.pending || !this.state.claimable }
|
: <Link button={this.props.button ? this.props.button : 'alt'} disabled={this.state.pending || !this.state.claimable }
|
||||||
label={ this.state.pending ? "Claiming..." : "Claim Reward"} onClick={() => { this.claimReward() }} />}
|
label={ this.state.pending ? __("Claiming...") : __("Claim Reward")} onClick={() => { this.claimReward() }} />}
|
||||||
{this.state.errorMessage ?
|
{this.state.errorMessage ?
|
||||||
<Modal isOpen={true} contentLabel="Reward Claim Error" className="error-modal" onConfirmed={() => { this.clearError() }}>
|
<Modal isOpen={true} contentLabel={__("Reward Claim Error")} className="error-modal" onConfirmed={() => { this.clearError() }}>
|
||||||
{this.state.errorMessage}
|
{this.state.errorMessage}
|
||||||
</Modal>
|
</Modal>
|
||||||
: ''}
|
: ''}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class SplashScreen extends React.Component {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
details: 'Starting daemon',
|
details: __('Starting daemon'),
|
||||||
isLagging: false,
|
isLagging: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ export class SplashScreen extends React.Component {
|
||||||
// TODO: This is a hack, and the logic should live in the daemon
|
// TODO: This is a hack, and the logic should live in the daemon
|
||||||
// to give us a better sense of when we are actually started
|
// to give us a better sense of when we are actually started
|
||||||
this.setState({
|
this.setState({
|
||||||
details: 'Waiting for name resolution',
|
details: __('Waiting for name resolution'),
|
||||||
isLagging: false
|
isLagging: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ export class SplashScreen extends React.Component {
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
isLagging: true,
|
isLagging: true,
|
||||||
message: "Failed to connect to LBRY",
|
message: __("Failed to connect to LBRY"),
|
||||||
details: "LBRY was unable to start and connect properly."
|
details: __("LBRY was unable to start and connect properly.")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,14 +2,19 @@ import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import lbry from './lbry.js';
|
import lbry from './lbry.js';
|
||||||
import lbryio from './lbryio.js';
|
import lbryio from './lbryio.js';
|
||||||
|
|
||||||
|
const i18n = require('y18n')({directory: 'app/locales'});
|
||||||
|
window.__ = i18n.__;
|
||||||
|
window.__n = i18n.__n;
|
||||||
|
|
||||||
import lighthouse from './lighthouse.js';
|
import lighthouse from './lighthouse.js';
|
||||||
import App from 'component/app/index.js';
|
import App from 'component/app/index.js';
|
||||||
import SplashScreen from 'component/splash.js';
|
|
||||||
import SnackBar from 'component/snackBar';
|
import SnackBar from 'component/snackBar';
|
||||||
import {AuthOverlay} from 'component/auth.js';
|
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import batchActions from 'util/batchActions'
|
import batchActions from 'util/batchActions'
|
||||||
import store from 'store.js';
|
import store from 'store.js';
|
||||||
|
import SplashScreen from 'component/splash.js';
|
||||||
|
import {AuthOverlay} from 'component/auth.js';
|
||||||
import {
|
import {
|
||||||
doChangePath,
|
doChangePath,
|
||||||
doNavigate,
|
doNavigate,
|
||||||
|
@ -30,9 +35,6 @@ const {remote, ipcRenderer, shell} = require('electron');
|
||||||
const contextMenu = remote.require('./menu/context-menu');
|
const contextMenu = remote.require('./menu/context-menu');
|
||||||
const app = require('./app')
|
const app = require('./app')
|
||||||
|
|
||||||
const i18n = require('y18n')({directory: 'app/locales'});
|
|
||||||
window.__ = i18n.__;
|
|
||||||
window.__n = i18n.__n;
|
|
||||||
|
|
||||||
lbry.showMenuIfNeeded();
|
lbry.showMenuIfNeeded();
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,11 @@ class ChannelPage extends React.Component{
|
||||||
|
|
||||||
let contentList
|
let contentList
|
||||||
if (claimsInChannel === undefined) {
|
if (claimsInChannel === undefined) {
|
||||||
contentList = <BusyMessage message="Fetching content" />
|
contentList = <BusyMessage message={__("Fetching content")} />
|
||||||
} else if (claimsInChannel) {
|
} else if (claimsInChannel) {
|
||||||
contentList = claimsInChannel.length ?
|
contentList = claimsInChannel.length ?
|
||||||
claimsInChannel.map((claim) => <FileTile key={claim.claim_id} uri={lbryuri.build({name: claim.name, claimId: claim.claim_id})} />) :
|
claimsInChannel.map((claim) => <FileTile key={claim.claim_id} uri={lbryuri.build({name: claim.name, claimId: claim.claim_id})} />) :
|
||||||
<span className="empty">No content found.</span>
|
<span className="empty">{__("No content found.")}</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
return <main className="main--single-column">
|
return <main className="main--single-column">
|
||||||
|
@ -41,11 +41,11 @@ class ChannelPage extends React.Component{
|
||||||
</div>
|
</div>
|
||||||
<div className="card__content">
|
<div className="card__content">
|
||||||
<p>
|
<p>
|
||||||
This channel page is a stub.
|
{__("This channel page is a stub.")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<h3 className="card-row__header">Published Content</h3>
|
<h3 className="card-row__header">{__("Published Content")}</h3>
|
||||||
{contentList}
|
{contentList}
|
||||||
</main>
|
</main>
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,17 +63,17 @@ class DeveloperPage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<section className="card">
|
<section className="card">
|
||||||
<h3>Developer Settings</h3>
|
<h3>{__("Developer Settings")}</h3>
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<label><FormField type="checkbox" onChange={(event) => { this.handleShowDeveloperMenuChange() }} checked={this.state.showDeveloperMenu} /> Show developer menu</label>
|
<label><FormField type="checkbox" onChange={(event) => { this.handleShowDeveloperMenuChange() }} checked={this.state.showDeveloperMenu} /> {__("Show developer menu")}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<label><FormField type="checkbox" onChange={(event) => { this.handleUseCustomLighthouseServersChange() }} checked={this.state.useCustomLighthouseServers} /> Use custom search servers</label>
|
<label><FormField type="checkbox" onChange={(event) => { this.handleUseCustomLighthouseServersChange() }} checked={this.state.useCustomLighthouseServers} /> {__("Use custom search servers")}</label>
|
||||||
</div>
|
</div>
|
||||||
{this.state.useCustomLighthouseServers
|
{this.state.useCustomLighthouseServers
|
||||||
? <div className="form-row">
|
? <div className="form-row">
|
||||||
<label>
|
<label>
|
||||||
Custom search servers (one per line)
|
{__("Custom search servers (one per line)")}
|
||||||
<div><FormField type="textarea" className="developer-page__custom-lighthouse-servers" value={this.state.customLighthouseServers} onChange={(event) => { this.handleCustomLighthouseServersChange() }} checked={this.state.debugMode} /></div>
|
<div><FormField type="textarea" className="developer-page__custom-lighthouse-servers" value={this.state.customLighthouseServers} onChange={(event) => { this.handleCustomLighthouseServersChange() }} checked={this.state.debugMode} /></div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,7 +83,7 @@ class DeveloperPage extends React.Component {
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<FormField name="file" ref="file" type="file" onChange={(event) => { this.handleUpgradeFileChange() }}/>
|
<FormField name="file" ref="file" type="file" onChange={(event) => { this.handleUpgradeFileChange() }}/>
|
||||||
|
|
||||||
<Link label="Force Upgrade" button="alt" onClick={(event) => { this.handleForceUpgradeClick() }} />
|
<Link label={__("Force Upgrade")} button="alt" onClick={(event) => { this.handleForceUpgradeClick() }} />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -38,7 +38,7 @@ class DiscoverPage extends React.Component{
|
||||||
<main>
|
<main>
|
||||||
{
|
{
|
||||||
fetchingFeaturedUris &&
|
fetchingFeaturedUris &&
|
||||||
<BusyMessage message="Fetching content" />
|
<BusyMessage message={__("Fetching content")} />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typeof featuredUris === "object" &&
|
typeof featuredUris === "object" &&
|
||||||
|
@ -48,7 +48,7 @@ class DiscoverPage extends React.Component{
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typeof featuredUris !== undefined &&
|
typeof featuredUris !== undefined &&
|
||||||
<div className="empty">Failed to load landing content.</div>
|
<div className="empty">{__("Failed to load landing content.")}</div>
|
||||||
}
|
}
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,9 +27,9 @@ class FileListDownloaded extends React.Component {
|
||||||
content = <FileList fileInfos={fileInfos} fetching={isPending} />
|
content = <FileList fileInfos={fileInfos} fetching={isPending} />
|
||||||
} else {
|
} else {
|
||||||
if (isPending) {
|
if (isPending) {
|
||||||
content = <BusyMessage message="Loading" />
|
content = <BusyMessage message={__("Loading")} />
|
||||||
} else {
|
} else {
|
||||||
content = <span>You haven't downloaded anything from LBRY yet. Go <Link onClick={() => navigate('/discover')} label="search for your first download" />!</span>
|
content = <span>{__("You haven't downloaded anything from LBRY yet. Go")} <Link onClick={() => navigate('/discover')} label={__("search for your first download")} />!</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ class FileListPublished extends React.Component {
|
||||||
content = <FileList fileInfos={fileInfos} fetching={isPending} fileTileShowEmpty={FileTile.SHOW_EMPTY_PENDING} />
|
content = <FileList fileInfos={fileInfos} fetching={isPending} fileTileShowEmpty={FileTile.SHOW_EMPTY_PENDING} />
|
||||||
} else {
|
} else {
|
||||||
if (isPending) {
|
if (isPending) {
|
||||||
content = <BusyMessage message="Loading" />
|
content = <BusyMessage message={__("Loading")} />
|
||||||
} else {
|
} else {
|
||||||
content = <span>It looks like you haven't published anything to LBRY yet. Go <Link onClick={() => navigate('/publish')} label="share your beautiful cats with the world" />!</span>
|
content = <span>{__("It looks like you haven't published anything to LBRY yet. Go")} <Link onClick={() => navigate('/publish')} label={__("share your beautiful cats with the world")} />!</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,16 +26,16 @@ const FormatItem = (props) => {
|
||||||
<table className="table-standard">
|
<table className="table-standard">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Content-Type</td><td>{mediaType}</td>
|
<td>{__("Content-Type")}</td><td>{mediaType}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Author</td><td>{author}</td>
|
<td>{__("Author")}</td><td>{author}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Language</td><td>{language}</td>
|
<td>{__("Language")}</td><td>{language}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>License</td><td>{license}</td>
|
<td>{__("License")}</td><td>{license}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -68,7 +68,7 @@ class FilePage extends React.Component{
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
if (!claim || !metadata) {
|
if (!claim || !metadata) {
|
||||||
return <span className="empty">Empty claim or metadata info.</span>
|
return <span className="empty">{__("Empty claim or metadata info.")}</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -117,7 +117,7 @@ class FilePage extends React.Component{
|
||||||
<FormatItem metadata={metadata} contentType={contentType} />
|
<FormatItem metadata={metadata} contentType={contentType} />
|
||||||
</div> : '' }
|
</div> : '' }
|
||||||
<div className="card__content">
|
<div className="card__content">
|
||||||
<Link href="https://lbry.io/dmca" label="report" className="button-text-help" />
|
<Link href="https://lbry.io/dmca" label={__("report")} className="button-text-help" />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
@ -125,4 +125,4 @@ class FilePage extends React.Component{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default FilePage;
|
export default FilePage;
|
||||||
|
|
|
@ -9,8 +9,8 @@ class StartPage extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<main className="main--single-column">
|
<main className="main--single-column">
|
||||||
<h3>__("LBRY is Closed")</h3>
|
<h3>{__("LBRY is Closed")}</h3>
|
||||||
<Link href="lbry://lbry" label="Click here to start LBRY" />
|
<Link href="lbry://lbry" label={__("Click here to start LBRY")} />
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,13 @@ export const selectPageTitle = createSelector(
|
||||||
(page, params) => {
|
(page, params) => {
|
||||||
switch (page) {
|
switch (page) {
|
||||||
case 'search':
|
case 'search':
|
||||||
return params.query ? `Search results for ${params.query}` : 'Search'
|
return params.query ? __("Search results for %s", params.query) : __('Search')
|
||||||
case 'settings':
|
case 'settings':
|
||||||
return 'Settings'
|
return __('Settings')
|
||||||
case 'help':
|
case 'help':
|
||||||
return 'Help'
|
return __('Help')
|
||||||
case 'report':
|
case 'report':
|
||||||
return 'Report'
|
return __('Report')
|
||||||
case 'wallet':
|
case 'wallet':
|
||||||
case 'send':
|
case 'send':
|
||||||
case 'receive':
|
case 'receive':
|
||||||
|
@ -54,19 +54,19 @@ export const selectPageTitle = createSelector(
|
||||||
case 'show':
|
case 'show':
|
||||||
return lbryuri.normalize(params.uri)
|
return lbryuri.normalize(params.uri)
|
||||||
case 'downloaded':
|
case 'downloaded':
|
||||||
return 'Downloads & Purchases'
|
return __('Downloads & Purchases')
|
||||||
case 'published':
|
case 'published':
|
||||||
return 'Publishes'
|
return __('Publishes')
|
||||||
case 'start':
|
case 'start':
|
||||||
return 'Start'
|
return __('Start')
|
||||||
case 'publish':
|
case 'publish':
|
||||||
return 'Publish'
|
return __('Publish')
|
||||||
case 'help':
|
case 'help':
|
||||||
return 'Help'
|
return __('Help')
|
||||||
case 'developer':
|
case 'developer':
|
||||||
return 'Developer'
|
return __('Developer')
|
||||||
case 'discover':
|
case 'discover':
|
||||||
return 'Home'
|
return __('Home')
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -142,22 +142,22 @@ export const selectHeaderLinks = createSelector(
|
||||||
case 'receive':
|
case 'receive':
|
||||||
case 'rewards':
|
case 'rewards':
|
||||||
return {
|
return {
|
||||||
'wallet': 'Overview',
|
'wallet': __('Overview'),
|
||||||
'send': 'Send',
|
'send': __('Send'),
|
||||||
'receive': 'Receive',
|
'receive': __('Receive'),
|
||||||
'rewards': 'Rewards',
|
'rewards': __('Rewards'),
|
||||||
};
|
};
|
||||||
case 'downloaded':
|
case 'downloaded':
|
||||||
case 'published':
|
case 'published':
|
||||||
return {
|
return {
|
||||||
'downloaded': 'Downloaded',
|
'downloaded': __('Downloaded'),
|
||||||
'published': 'Published',
|
'published': __('Published'),
|
||||||
};
|
};
|
||||||
case 'settings':
|
case 'settings':
|
||||||
case 'help':
|
case 'help':
|
||||||
return {
|
return {
|
||||||
'settings': 'Settings',
|
'settings': __('Settings'),
|
||||||
'help': 'Help',
|
'help': __('Help'),
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
@ -203,4 +203,4 @@ export const selectSnackBar = createSelector(
|
||||||
export const selectSnackBarSnacks = createSelector(
|
export const selectSnackBarSnacks = createSelector(
|
||||||
selectSnackBar,
|
selectSnackBar,
|
||||||
(snackBar) => snackBar.snacks || []
|
(snackBar) => snackBar.snacks || []
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue