From c3df03d4fc844520f67fa565925efd783787cb97 Mon Sep 17 00:00:00 2001 From: Intnick Date: Thu, 25 May 2017 18:29:56 +0200 Subject: [PATCH 01/14] initial merge --- app/locales/en.json | 78 ++++++++++++++++++++++++++++++++++++ ui/js/main.js | 6 ++- ui/js/page/discover/view.jsx | 6 +-- 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 app/locales/en.json diff --git a/app/locales/en.json b/app/locales/en.json new file mode 100644 index 000000000..96527d026 --- /dev/null +++ b/app/locales/en.json @@ -0,0 +1,78 @@ +{ + "Edit": "Edit", + "Help": "Help", + "Developer": "Developer", + "Reload": "Reload", + "Toggle Developer Tools": "Toggle Developer Tools", + "Inspect Element": "Inspect Element", + "connectionString": "connectionString", + "Method": "Method", + "Parameters": "Parameters", + "Error code": "Error code", + "Error message": "Error message", + "Error data": "Error data", + "Home": "Home", + "Publish": "Publish", + "This LBC remains yours and the deposit can be undone at any time.": "This LBC remains yours and the deposit can be undone at any time.", + "Content": "Content", + "What are you publishing?": "What are you publishing?", + "Access": "Access", + "Select a URL for this publish.": "Select a URL for this publish.", + "How much does this content cost?": "How much does this content cost?", + "Price": "Price", + "Free": "Free", + "Choose price...": "Choose price...", + "US Dollars": "US Dollars", + "LBRY credits": "LBRY credits", + "Public Domain": "Public Domain", + "Creative Commons Attribution 4.0 International": "Creative Commons Attribution 4.0 International", + "Creative Commons Attribution-ShareAlike 4.0 International": "Creative Commons Attribution-ShareAlike 4.0 International", + "Creative Commons Attribution-NoDerivatives 4.0 International": "Creative Commons Attribution-NoDerivatives 4.0 International", + "Creative Commons Attribution-NonCommercial 4.0 International": "Creative Commons Attribution-NonCommercial 4.0 International", + "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", + "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International": "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International", + "Copyrighted...": "Copyrighted...", + "Other...": "Other...", + "Identity": "Identity", + "Who created this content?": "Who created this content?", + "Anonymous": "Anonymous", + "New identity...": "New identity...", + "Address": "Address", + "Where should this content permanently reside?": "Where should this content permanently reside?", + "Read more": "Read more", + "Terms of Service": "Terms of Service", + "Deposit": "Deposit", + "This URL is unused.": "This URL is unused.", + "LBRY names must contain only letters, numbers and dashes.": "LBRY names must contain only letters, numbers and dashes.", + "Title": "Title", + "Thumbnail URL": "Thumbnail URL", + "Description": "Description", + "Description of your content": "Description of your content", + "Language": "Language", + "English": "English", + "Chinese": "Chinese", + "French": "French", + "German": "German", + "Japanese": "Japanese", + "Russian": "Russian", + "Spanish": "Spanish", + "Maturity": "Maturity", + "All Ages": "All Ages", + "Adults Only": "Adults Only", + "Cancel": "Cancel", + "File published": "File published", + "I agree to the": "I agree to the", + "LBRY terms of service": "LBRY terms of service", + "Your file has been published to LBRY at the address": "Your file has been published to LBRY at the address", + "The file will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.": "The file will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.", + "Error publishing file": "Error publishing file", + "The following error occurred when attempting to publish your file": "The following error occurred when attempting to publish your file", + "A deposit of at least \"%s\" credit is required to win \"%s\". However, you can still get a permanent URL for any amount.": { + "one": "A deposit of at least \"%s\" credit is required to win \"%s\". However, you can still get a permanent URL for any amount.", + "other": "A deposit of at least \"%s\" credits is required to win \"%s\". However, you can still get a permanent URL for any amount." + }, + "Connecting": "Connecting", + "Discover": "Discover", + "Fetching content": "Fetching content", + "What's this?": "What's this?" +} \ No newline at end of file diff --git a/ui/js/main.js b/ui/js/main.js index 454d6e5b5..13269ca8e 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -30,6 +30,10 @@ const {remote, ipcRenderer, shell} = require('electron'); const contextMenu = remote.require('./menu/context-menu'); const app = require('./app') +const i18n = require('y18n')({directory: 'app/locales'}); +window.__ = i18n.__; +window.__n = i18n.__n; + lbry.showMenuIfNeeded(); window.addEventListener('contextmenu', (event) => { @@ -93,7 +97,7 @@ var init = function() { if (window.sessionStorage.getItem('loaded') == 'y') { onDaemonReady(); } else { - ReactDOM.render(, canvas); + ReactDOM.render(, canvas); } }; diff --git a/ui/js/page/discover/view.jsx b/ui/js/page/discover/view.jsx index 91cdfafda..ba1b372e7 100644 --- a/ui/js/page/discover/view.jsx +++ b/ui/js/page/discover/view.jsx @@ -5,7 +5,7 @@ import FileCard from 'component/fileCard'; import {BusyMessage} from 'component/common.js'; import ToolTip from 'component/tooltip.js'; -const communityCategoryToolTipText = ('Community Content is a public space where anyone can share content with the ' + +const communityCategoryToolTipText = __('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!'); @@ -17,7 +17,7 @@ const FeaturedCategory = (props) => { return

{category} - {category && category.match(/^community/i) && } + {category && category.match(/^community/i) && }

{names && names.map(name => )}
@@ -55,4 +55,4 @@ class DiscoverPage extends React.Component{ } } -export default DiscoverPage; \ No newline at end of file +export default DiscoverPage; From d366b456343a22289922852d2a2431c564043ce4 Mon Sep 17 00:00:00 2001 From: Intnick Date: Mon, 22 May 2017 14:29:30 +0200 Subject: [PATCH 02/14] initial merge --- app/locales/en.json | 2 +- ui/js/page/publish/view.jsx | 137 ++++++++++++++++++------------------ 2 files changed, 71 insertions(+), 68 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 96527d026..8c63406bf 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -75,4 +75,4 @@ "Discover": "Discover", "Fetching content": "Fetching content", "What's this?": "What's this?" -} \ No newline at end of file +} diff --git a/ui/js/page/publish/view.jsx b/ui/js/page/publish/view.jsx index 0aa52c9b1..91b56d0cc 100644 --- a/ui/js/page/publish/view.jsx +++ b/ui/js/page/publish/view.jsx @@ -179,7 +179,7 @@ class PublishPage extends React.Component { } if (!lbryuri.isValidName(rawName, false)) { - this.refs.name.showError('LBRY names must contain only letters, numbers and dashes.'); + this.refs.name.showError(__("LBRY names must contain only letters, numbers and dashes.")); return; } @@ -266,7 +266,7 @@ class PublishPage extends React.Component { }; if (licenseType == 'copyright') { - newState.copyrightNotice = 'All rights reserved.' + newState.copyrightNotice = __("All rights reserved.") } this.setState(newState); @@ -302,7 +302,7 @@ class PublishPage extends React.Component { const newChannelName = (event.target.value.startsWith('@') ? event.target.value : '@' + event.target.value); if (newChannelName.length > 1 && !lbryuri.isValidName(newChannelName.substr(1), false)) { - this.refs.newChannelName.showError('LBRY channel names must contain only letters, numbers and dashes.'); + this.refs.newChannelName.showError(__("LBRY channel names must contain only letters, numbers and dashes.")); return; } else { this.refs.newChannelName.clearError() @@ -327,7 +327,7 @@ class PublishPage extends React.Component { handleCreateChannelClick(event) { if (this.state.newChannelName.length < 5) { - this.refs.newChannelName.showError('LBRY channel names must be at least 4 characters in length.'); + this.refs.newChannelName.showError(__("LBRY channel names must be at least 4 characters in length.")); return; } @@ -346,7 +346,7 @@ class PublishPage extends React.Component { }, 5000); }, (error) => { // TODO: better error handling - this.refs.newChannelName.showError('Unable to create channel due to an internal error.'); + this.refs.newChannelName.showError(__("Unable to create channel due to an internal error.")); this.setState({ creatingChannel: false, }); @@ -377,14 +377,17 @@ class PublishPage extends React.Component { getNameBidHelpText() { if (!this.state.name) { - return "Select a URL for this publish."; + return __("Select a URL for this publish."); } else if (this.state.nameResolved === false) { - return "This URL is unused."; + return __("This URL is unused."); } else if (this.state.myClaimExists) { - return "You have already used this URL. Publishing to it again will update your previous publish." + return __("You have already used this URL. Publishing to it again will update your previous publish.") } else if (this.state.topClaimValue) { - return A deposit of at least {this.state.topClaimValue} {this.state.topClaimValue == 1 ? 'credit ' : 'credits '} - is required to win {this.state.name}. However, you can still get a permanent URL for any amount. + return {__n("A deposit of at least \"%s\" credit is required to win \"%s\". However, you can still get a permanent URL for any amount." + , "A deposit of at least \"%s\" credits is required to win \"%s\". However, you can still get a permanent URL for any amount." + , this.state.topClaimValue /*pluralization param*/ + , this.state.topClaimValue, this.state.name /*regular params*/ + )} } else { return ''; } @@ -401,49 +404,49 @@ class PublishPage extends React.Component { return null; } - const lbcInputHelp = "This LBC remains yours and the deposit can be undone at any time." + const lbcInputHelp = __("This LBC remains yours and the deposit can be undone at any time."); return (
{ this.handleSubmit(event) }}>
-

Content

+

{__("Content")}

- What are you publishing? + {__("What are you publishing?")}
{ this.onFileChange(event) }} - helper={this.state.myClaimExists ? "If you don't choose a file, the file from your existing claim will be used." : null}/> + helper={this.state.myClaimExists ? __("If you don't choose a file, the file from your existing claim will be used.") : null}/>
{ !this.state.hasFile ? '' :
- +
- +
- +
- - - - - - - - + + + + + + + +
- + {/* */} - - + +
} @@ -451,73 +454,73 @@ class PublishPage extends React.Component {
-

Access

+

{__("Access")}

- How much does this content cost? + {__("How much does this content cost?")}
- +
- { this.handleFeePrefChange(false) } } defaultChecked={!this.state.isFee} /> - { this.handleFeePrefChange(false) } } defaultChecked={!this.state.isFee} /> + { this.handleFeePrefChange(true) } } defaultChecked={this.state.isFee} /> this.handleFeeAmountChange(event)} /> { this.handleFeeCurrencyChange(event) }}> - - + + { this.state.isFee ?
- If you choose to price this content in dollars, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase. + {__("If you choose to price this content in dollars, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase.")}
: '' } { this.handleLicenseChange(event) }}> - - - - - - - - - + + + + + + + + + {this.state.copyrightChosen - ? { this.handleCopyrightNoticeChange(event) }} /> : null} {this.state.otherLicenseChosen ? - { this.handleOtherLicenseDescriptionChange() }} /> + { this.handleOtherLicenseDescriptionChange() }} /> : null} {this.state.otherLicenseChosen ? - { this.handleOtherLicenseUrlChange(event) }} /> + { this.handleOtherLicenseUrlChange(event) }} /> : null}
-

Identity

+

{__("Identity")}

- Who created this content? + {__("Who created this content?")}
{ this.handleChannelChange(event) }} value={this.state.channel}> - + {this.state.channels.map(({name}) => )} - +
{this.state.channel == 'new' ?
- { this.handleNewChannelNameChange(event) }} ref={newChannelName => { this.refs.newChannelName = newChannelName }} + { this.handleNewChannelNameChange(event) }} ref={newChannelName => { this.refs.newChannelName = newChannelName }} value={this.state.newChannelName} /> - { this.handleNewChannelBidChange(event) }} value={this.state.newChannelBid} />
- { this.handleCreateChannelClick(event) }} disabled={this.state.creatingChannel} /> + { this.handleCreateChannelClick(event) }} disabled={this.state.creatingChannel} />
: null} @@ -534,8 +537,8 @@ class PublishPage extends React.Component {
-

Address

-
Where should this content permanently reside? .
+

{__("Address")}

+
{__("Where should this content permanently reside?")} .
{ this.handleNameChange(event) }} @@ -546,7 +549,7 @@ class PublishPage extends React.Component { { this.handleBidChange(event) }} value={this.state.bid} @@ -557,30 +560,30 @@ class PublishPage extends React.Component {
-

Terms of Service

+

{__("Terms of Service")}

I agree to the + {__("I agree to the")} } type="checkbox" name="tos_agree" ref={(field) => { this.refs.tos_agree = field }} onChange={(event) => { this.handleTOSChange(event)}} />
- { this.handleSubmit(event) }} disabled={this.state.submitting} /> - + { this.handleSubmit(event) }} disabled={this.state.submitting} /> +
- { this.handlePublishStartedConfirmed(event) }}> -

Your file has been published to LBRY at the address lbry://{this.state.name}!

-

The file will take a few minutes to appear for other LBRY users. Until then it will be listed as "pending" under your published files.

+

{__("Your file has been published to LBRY at the address")} lbry://{this.state.name}!

+

{__('The file will take a few minutes to appear for other LBRY users. Until then it will be listed as "pending" under your published files.')}

- { this.closeModal(event) }}> - The following error occurred when attempting to publish your file: {this.state.errorMessage} + {__("The following error occurred when attempting to publish your file")}: {this.state.errorMessage}
); From 936b56c4729d61258592f87e2c899c4f705973a2 Mon Sep 17 00:00:00 2001 From: Intnick Date: Mon, 22 May 2017 01:32:00 +0200 Subject: [PATCH 03/14] initial merge --- ui/js/page/start.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/js/page/start.js b/ui/js/page/start.js index 9a2b388b1..c3af27817 100644 --- a/ui/js/page/start.js +++ b/ui/js/page/start.js @@ -9,7 +9,7 @@ class StartPage extends React.Component { render() { return (
-

LBRY is Closed

+

__("LBRY is Closed")

); From df2192116cbbc09ecc3a02999dafd768a4f30c62 Mon Sep 17 00:00:00 2001 From: Intnick Date: Thu, 25 May 2017 19:31:10 +0200 Subject: [PATCH 04/14] finalization of i18n setup to i18n branch --- app/locales/en.json | 5 +++-- ui/js/page/discover/view.jsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 8c63406bf..c725e2624 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -74,5 +74,6 @@ "Connecting": "Connecting", "Discover": "Discover", "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!" +} \ No newline at end of file diff --git a/ui/js/page/discover/view.jsx b/ui/js/page/discover/view.jsx index ba1b372e7..10e8309c9 100644 --- a/ui/js/page/discover/view.jsx +++ b/ui/js/page/discover/view.jsx @@ -5,7 +5,7 @@ import FileCard from 'component/fileCard'; import {BusyMessage} from 'component/common.js'; import ToolTip from 'component/tooltip.js'; -const communityCategoryToolTipText = __('Community Content is a public space where anyone can share content with the ' + +const communityCategoryToolTipText = ('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!'); @@ -17,7 +17,7 @@ const FeaturedCategory = (props) => { return

{category} - {category && category.match(/^community/i) && } + {category && category.match(/^community/i) && }

{names && names.map(name => )}
From 8917d9e7e7e61cce0049938874bf63f02123c957 Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 02:16:25 +0200 Subject: [PATCH 05/14] moved the import of y18n component before some other imports; translations for auth developer --- app/locales/en.json | 70 +++++++++++++++++++- ui/js/component/auth.js | 80 +++++++++++------------ ui/js/component/common.js | 6 +- ui/js/component/downloadingModal/view.jsx | 14 ++-- ui/js/component/errorModal/view.jsx | 18 ++--- ui/js/component/file-selector.js | 6 +- ui/js/component/form.js | 4 +- ui/js/component/modal.js | 13 ++-- ui/js/component/reward-link.js | 8 +-- ui/js/component/splash.js | 8 +-- ui/js/main.js | 12 ++-- ui/js/page/channel/view.jsx | 8 +-- ui/js/page/developer.js | 10 +-- ui/js/page/discover/view.jsx | 4 +- ui/js/page/fileListDownloaded/view.jsx | 4 +- ui/js/page/fileListPublished/view.jsx | 4 +- ui/js/page/filePage/view.jsx | 14 ++-- ui/js/page/start.js | 4 +- ui/js/selectors/app.js | 40 ++++++------ 19 files changed, 200 insertions(+), 127 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index c725e2624..7c4e78d5e 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -75,5 +75,73 @@ "Discover": "Discover", "Fetching content": "Fetching content", "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 way different underneath.": "Using LBRY is like dating a centaur. Totally normal up top, and way different 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" } \ No newline at end of file diff --git a/ui/js/component/auth.js b/ui/js/component/auth.js index 1d1e8a406..12c6d7158 100644 --- a/ui/js/component/auth.js +++ b/ui/js/component/auth.js @@ -55,11 +55,11 @@ class SubmitEmailStage extends React.Component { return (
{ this.handleSubmit(event) }}> - { this._emailRow = ref }} type="text" label="Email" placeholder="scrwvwls@lbry.io" + { this._emailRow = ref }} type="text" label={__("Email")} placeholder="scrwvwls@lbry.io" name="email" value={this.state.email} onChange={(event) => { this.handleEmailChanged(event) }} />
- { this.handleSubmit(event) }} /> + { this.handleSubmit(event) }} />
@@ -102,7 +102,7 @@ class ConfirmEmailStage extends React.Component { if (userEmail.is_verified) { this.props.setStage("welcome") } 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); } @@ -111,14 +111,14 @@ class ConfirmEmailStage extends React.Component { return (
{ this.handleSubmit(event) }}> - { this._codeRow = ref }} type="text" + { this._codeRow = ref }} type="text" 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.")}/>
- { this.handleSubmit(event)}} /> + { this.handleSubmit(event)}} />
- No code? { this.props.setStage("nocode")}} label="Click here" />. + {__("No code?")} { this.props.setStage("nocode")}} label={__("Click here")} />.
@@ -150,26 +150,26 @@ class WelcomeStage extends React.Component { render() { return ( !this.state.hasReward ? - +
-

Welcome to LBRY.

-

Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.

-

Up top, LBRY is similar to popular media sites.

-

Below, LBRY is controlled by users -- you -- via blockchain and decentralization.

-

Thank you for making content freedom possible! Here's a nickel, kid.

+

{__("Welcome to LBRY.")}

+

{__("Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.")}

+

{__("Up top, LBRY is similar to popular media sites.")}

+

{__("Below, LBRY is controlled by users -- you -- via blockchain and decentralization.")}

+

{__("Thank you for making content freedom possible! Here's a nickel, kid.")}

{ this.onRewardClaim(event) }} onRewardFailure={() => this.props.setStage(null)} onConfirmed={() => { this.props.setStage(null) }} />
: - { this.props.setStage(null) }}> + { this.props.setStage(null) }}>
-

About Your Reward

-

You earned a reward of LBRY credits, or LBC.

-

This reward will show in your Wallet momentarily, probably while you are reading this message.

-

LBC is used to compensate creators, to publish, and to have say in how the network works.

-

No need to understand it all just yet! Try watching or downloading something next.

-

Finally, know that LBRY is an early beta and that it earns the name.

+

{__("About Your Reward")}

+

{__("You earned a reward of ")} {__("LBRY credits, or \"LBC\".")}

+

{__("This reward will show in your Wallet momentarily, probably while you are reading this message.")}

+

{__("LBC is used to compensate creators, to publish, and to have say in how the network works.")}

+

{__("No need to understand it all just yet! Try watching or downloading something next.")}

+

{__("Finally, know that LBRY is an early beta and that it earns the name.")}

); @@ -178,16 +178,16 @@ class WelcomeStage extends React.Component { const ErrorStage = (props) => { return
-

An error was encountered that we cannot continue from.

-

At least we're earning the name beta.

- { props.errorText ?

Message: {props.errorText}

: '' } - { window.location.reload() } } /> +

{__("An error was encountered that we cannot continue from.")}

+

{__("At least we're earning the name beta.")}

+ { props.errorText ?

{__("Message:")} {props.errorText}

: '' } + { window.location.reload() } } />
} const PendingStage = (props) => { return
-

Preparing for first access

+

{__("Preparing for first access")}

} @@ -230,20 +230,20 @@ class CodeRequiredStage extends React.Component { return (
-

Access to LBRY is restricted as we build and scale the network.

-

There are two ways in:

-

Own LBRY Credits

-

If you own at least 1 LBC, you can get in right now.

+

{__("Access to LBRY is restricted as we build and scale the network.")}

+

{__("There are two ways in:")}

+

{__("Own LBRY Credits")}

+

{__("If you own at least 1 LBC, you can get in right now.")}

{ setLocal('auth_bypassed', true); this.props.setStage(null); }} - disabled={disabled} label="Let Me In" button={ disabled ? "alt" : "primary" } />

-

Your balance is . To increase your balance, send credits to this address:

-

-

If you don't understand how to send credits, then...

+ disabled={disabled} label={__("Let Me In")} button={ disabled ? "alt" : "primary" } />

+

{__("Your balance is ")}. {__("To increase your balance, send credits to this address:")}

+

+

{__("If you don't understand how to send credits, then...")}

-

Wait For A Code

-

If you provide your email, you'll automatically receive a notification when the system is open.

-

{ this.props.setStage("email"); }} label="Return" />

+

{__("Wait For A Code")}

+

{__("If you provide your email, you'll automatically receive a notification when the system is open.")}

+

{ this.props.setStage("email"); }} label={__("Return")} />

); @@ -312,16 +312,16 @@ export class AuthOverlay extends React.Component { const StageContent = this._stages[this.state.stage]; if (!StageContent) { - return Unknown authentication step. + return {__("Unknown authentication step.")} } return ( this.state.stage != "welcome" ? - -

LBRY Early Access

+ +

{__("LBRY Early Access")}

{ this.setStage(stage, stageProps) }} />
: { this.setStage(stage, stageProps) }} {...this.state.stageProps} /> ); } -} \ No newline at end of file +} diff --git a/ui/js/component/common.js b/ui/js/component/common.js index c11e0d14c..d864a1c48 100644 --- a/ui/js/component/common.js +++ b/ui/js/component/common.js @@ -68,9 +68,9 @@ export class CreditAmount extends React.Component { const formattedAmount = lbry.formatCredits(this.props.amount, this.props.precision); let amountText; if (this.props.showFree && parseFloat(formattedAmount) == 0) { - amountText = 'free'; + amountText = __('free'); } else if (this.props.label) { - amountText = formattedAmount + (parseFloat(formattedAmount) == 1 ? ' credit' : ' credits'); + amountText = formattedAmount + (parseFloat(formattedAmount) == 1 ? __(' credit') : __(' credits')); } else { amountText = formattedAmount; } @@ -80,7 +80,7 @@ export class CreditAmount extends React.Component { {amountText} - { this.props.isEstimate ? * : null } + { this.props.isEstimate ? * : null } ); } diff --git a/ui/js/component/downloadingModal/view.jsx b/ui/js/component/downloadingModal/view.jsx index b59605e28..32c6d030b 100644 --- a/ui/js/component/downloadingModal/view.jsx +++ b/ui/js/component/downloadingModal/view.jsx @@ -15,22 +15,22 @@ class DownloadingModal extends React.Component { } = this.props return ( - - Downloading Update{downloadProgress ? `: ${downloadProgress}%` : null} + + {__("Downloading Update")}{downloadProgress ? `: ${downloadProgress}%` : null} {downloadComplete ? (

-

Click "Begin Upgrade" to start the upgrade process.

-

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.

+

{__("Click \"Begin Upgrade\" to start the upgrade process.")}

+

{__("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.")}

) : null }
{downloadComplete - ? + ? : null} - +
) diff --git a/ui/js/component/errorModal/view.jsx b/ui/js/component/errorModal/view.jsx index c494c9cb1..a5cbcd8c7 100644 --- a/ui/js/component/errorModal/view.jsx +++ b/ui/js/component/errorModal/view.jsx @@ -15,12 +15,12 @@ class ErrorModal extends React.Component { const errorObj = typeof error === "string" ? { error: error } : error const error_key_labels = { - connectionString: 'API connection string', - method: 'Method', - params: 'Parameters', - code: 'Error code', - message: 'Error message', - data: 'Error data', + connectionString: __('API connection string'), + method: __('Method'), + params: __('Parameters'), + code: __('Error code'), + message: __('Error message'), + data: __('Error data'), } @@ -35,16 +35,16 @@ class ErrorModal extends React.Component { return( -

Error

+

{__("Error")}

-

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.")}

) diff --git a/ui/js/component/file-selector.js b/ui/js/component/file-selector.js index 4670f4830..786d82caf 100644 --- a/ui/js/component/file-selector.js +++ b/ui/js/component/file-selector.js @@ -41,14 +41,14 @@ class FileSelector extends React.Component {
{' '} {this.state.path ? this.state.path : - 'No File Chosen'} + __('No File Chosen')}
); diff --git a/ui/js/component/form.js b/ui/js/component/form.js index 416011df3..809ebe534 100644 --- a/ui/js/component/form.js +++ b/ui/js/component/form.js @@ -21,7 +21,7 @@ export class FormField extends React.Component { constructor(props) { super(props); - this._fieldRequiredText = 'This field is required'; + this._fieldRequiredText = __('This field is required'); this._type = null; this._element = null; @@ -136,7 +136,7 @@ export class FormRow extends React.Component { constructor(props) { super(props); - this._fieldRequiredText = 'This field is required'; + this._fieldRequiredText = __('This field is required'); this.state = { isError: false, diff --git a/ui/js/component/modal.js b/ui/js/component/modal.js index bd3c1eb3c..89598e9e8 100644 --- a/ui/js/component/modal.js +++ b/ui/js/component/modal.js @@ -2,6 +2,9 @@ import React from 'react'; import ReactModal from 'react-modal'; import Link from 'component/link'; +const i18n = require('y18n')({directory: 'app/locales'}); + + export class Modal extends React.Component { static propTypes = { @@ -18,8 +21,8 @@ export class Modal extends React.Component { static defaultProps = { type: 'alert', overlay: true, - confirmButtonLabel: 'OK', - abortButtonLabel: 'Cancel', + confirmButtonLabel: i18n.__('OK'), + abortButtonLabel: i18n.__('Cancel'), confirmButtonDisabled: false, abortButtonDisabled: false, } @@ -52,9 +55,9 @@ export class ExpandableModal extends React.Component { } static defaultProps = { - confirmButtonLabel: 'OK', - expandButtonLabel: 'Show More...', - hideButtonLabel: 'Show Less', + confirmButtonLabel: i18n.__('OK'), + expandButtonLabel: i18n.__('Show More...'), + hideButtonLabel: i18n.__('Show Less'), } constructor(props) { diff --git a/ui/js/component/reward-link.js b/ui/js/component/reward-link.js index 31bd90e28..bb2c169cf 100644 --- a/ui/js/component/reward-link.js +++ b/ui/js/component/reward-link.js @@ -77,15 +77,15 @@ export class RewardLink extends React.Component { return (
{this.props.claimed - ? Reward claimed. + ? {__("Reward claimed.")} : { this.claimReward() }} />} + label={ this.state.pending ? __("Claiming...") : __("Claim Reward")} onClick={() => { this.claimReward() }} />} {this.state.errorMessage ? - { this.clearError() }}> + { this.clearError() }}> {this.state.errorMessage} : ''}
); } -} \ No newline at end of file +} diff --git a/ui/js/component/splash.js b/ui/js/component/splash.js index e2be56b67..d5433398a 100644 --- a/ui/js/component/splash.js +++ b/ui/js/component/splash.js @@ -12,7 +12,7 @@ export class SplashScreen extends React.Component { super(props); this.state = { - details: 'Starting daemon', + details: __('Starting daemon'), 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 // to give us a better sense of when we are actually started this.setState({ - details: 'Waiting for name resolution', + details: __('Waiting for name resolution'), isLagging: false }); @@ -54,8 +54,8 @@ export class SplashScreen extends React.Component { } else { this.setState({ isLagging: true, - message: "Failed to connect to LBRY", - details: "LBRY was unable to start and connect properly." + message: __("Failed to connect to LBRY"), + details: __("LBRY was unable to start and connect properly.") }) } }) diff --git a/ui/js/main.js b/ui/js/main.js index 13269ca8e..79c92c7d1 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -2,14 +2,19 @@ import React from 'react'; import ReactDOM from 'react-dom'; import lbry from './lbry.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 App from 'component/app/index.js'; -import SplashScreen from 'component/splash.js'; import SnackBar from 'component/snackBar'; -import {AuthOverlay} from 'component/auth.js'; import { Provider } from 'react-redux'; import batchActions from 'util/batchActions' import store from 'store.js'; +import SplashScreen from 'component/splash.js'; +import {AuthOverlay} from 'component/auth.js'; import { doChangePath, doNavigate, @@ -30,9 +35,6 @@ const {remote, ipcRenderer, shell} = require('electron'); const contextMenu = remote.require('./menu/context-menu'); const app = require('./app') -const i18n = require('y18n')({directory: 'app/locales'}); -window.__ = i18n.__; -window.__n = i18n.__n; lbry.showMenuIfNeeded(); diff --git a/ui/js/page/channel/view.jsx b/ui/js/page/channel/view.jsx index 05b447c60..eb09ea4d5 100644 --- a/ui/js/page/channel/view.jsx +++ b/ui/js/page/channel/view.jsx @@ -27,11 +27,11 @@ class ChannelPage extends React.Component{ let contentList if (claimsInChannel === undefined) { - contentList = + contentList = } else if (claimsInChannel) { contentList = claimsInChannel.length ? claimsInChannel.map((claim) => ) : - No content found. + {__("No content found.")} } return
@@ -41,11 +41,11 @@ class ChannelPage extends React.Component{

- This channel page is a stub. + {__("This channel page is a stub.")}

-

Published Content

+

{__("Published Content")}

{contentList}
} diff --git a/ui/js/page/developer.js b/ui/js/page/developer.js index 9e7175fd3..4ac1a133b 100644 --- a/ui/js/page/developer.js +++ b/ui/js/page/developer.js @@ -63,17 +63,17 @@ class DeveloperPage extends React.Component { return (
-

Developer Settings

+

{__("Developer Settings")}

- +
- +
{this.state.useCustomLighthouseServers ?
@@ -83,7 +83,7 @@ class DeveloperPage extends React.Component {
{ this.handleUpgradeFileChange() }}/>   - { this.handleForceUpgradeClick() }} /> + { this.handleForceUpgradeClick() }} />
diff --git a/ui/js/page/discover/view.jsx b/ui/js/page/discover/view.jsx index 10e8309c9..fff8663b8 100644 --- a/ui/js/page/discover/view.jsx +++ b/ui/js/page/discover/view.jsx @@ -38,7 +38,7 @@ class DiscoverPage extends React.Component{
{ fetchingFeaturedUris && - + } { typeof featuredUris === "object" && @@ -48,7 +48,7 @@ class DiscoverPage extends React.Component{ } { typeof featuredUris !== undefined && -
Failed to load landing content.
+
{__("Failed to load landing content.")}
}
) diff --git a/ui/js/page/fileListDownloaded/view.jsx b/ui/js/page/fileListDownloaded/view.jsx index 670b27191..df763195b 100644 --- a/ui/js/page/fileListDownloaded/view.jsx +++ b/ui/js/page/fileListDownloaded/view.jsx @@ -27,9 +27,9 @@ class FileListDownloaded extends React.Component { content = } else { if (isPending) { - content = + content = } else { - content = You haven't downloaded anything from LBRY yet. Go navigate('/discover')} label="search for your first download" />! + content = {__("You haven't downloaded anything from LBRY yet. Go")} navigate('/discover')} label={__("search for your first download")} />! } } diff --git a/ui/js/page/fileListPublished/view.jsx b/ui/js/page/fileListPublished/view.jsx index 1fe0ac592..bf1374a45 100644 --- a/ui/js/page/fileListPublished/view.jsx +++ b/ui/js/page/fileListPublished/view.jsx @@ -49,9 +49,9 @@ class FileListPublished extends React.Component { content = } else { if (isPending) { - content = + content = } else { - content = It looks like you haven't published anything to LBRY yet. Go navigate('/publish')} label="share your beautiful cats with the world" />! + content = {__("It looks like you haven't published anything to LBRY yet. Go")} navigate('/publish')} label={__("share your beautiful cats with the world")} />! } } diff --git a/ui/js/page/filePage/view.jsx b/ui/js/page/filePage/view.jsx index 2373588b7..660b8a366 100644 --- a/ui/js/page/filePage/view.jsx +++ b/ui/js/page/filePage/view.jsx @@ -26,16 +26,16 @@ const FormatItem = (props) => { - + - + - + - +
Content-Type{mediaType}{__("Content-Type")}{mediaType}
Author{author}{__("Author")}{author}
Language{language}{__("Language")}{language}
License{license}{__("License")}{license}
@@ -68,7 +68,7 @@ class FilePage extends React.Component{ } = this.props if (!claim || !metadata) { - return Empty claim or metadata info. + return {__("Empty claim or metadata info.")} } const { @@ -117,7 +117,7 @@ class FilePage extends React.Component{ : '' }
- +
@@ -125,4 +125,4 @@ class FilePage extends React.Component{ } } -export default FilePage; \ No newline at end of file +export default FilePage; diff --git a/ui/js/page/start.js b/ui/js/page/start.js index c3af27817..3caf500a5 100644 --- a/ui/js/page/start.js +++ b/ui/js/page/start.js @@ -9,8 +9,8 @@ class StartPage extends React.Component { render() { return (
-

__("LBRY is Closed")

- +

{__("LBRY is Closed")}

+
); } diff --git a/ui/js/selectors/app.js b/ui/js/selectors/app.js index 25ed2403c..9509f8f7a 100644 --- a/ui/js/selectors/app.js +++ b/ui/js/selectors/app.js @@ -39,13 +39,13 @@ export const selectPageTitle = createSelector( (page, params) => { switch (page) { case 'search': - return params.query ? `Search results for ${params.query}` : 'Search' + return params.query ? __("Search results for %s", params.query) : __('Search') case 'settings': - return 'Settings' + return __('Settings') case 'help': - return 'Help' + return __('Help') case 'report': - return 'Report' + return __('Report') case 'wallet': case 'send': case 'receive': @@ -54,19 +54,19 @@ export const selectPageTitle = createSelector( case 'show': return lbryuri.normalize(params.uri) case 'downloaded': - return 'Downloads & Purchases' + return __('Downloads & Purchases') case 'published': - return 'Publishes' + return __('Publishes') case 'start': - return 'Start' + return __('Start') case 'publish': - return 'Publish' + return __('Publish') case 'help': - return 'Help' + return __('Help') case 'developer': - return 'Developer' + return __('Developer') case 'discover': - return 'Home' + return __('Home') default: return ''; } @@ -142,22 +142,22 @@ export const selectHeaderLinks = createSelector( case 'receive': case 'rewards': return { - 'wallet': 'Overview', - 'send': 'Send', - 'receive': 'Receive', - 'rewards': 'Rewards', + 'wallet': __('Overview'), + 'send': __('Send'), + 'receive': __('Receive'), + 'rewards': __('Rewards'), }; case 'downloaded': case 'published': return { - 'downloaded': 'Downloaded', - 'published': 'Published', + 'downloaded': __('Downloaded'), + 'published': __('Published'), }; case 'settings': case 'help': return { - 'settings': 'Settings', - 'help': 'Help', + 'settings': __('Settings'), + 'help': __('Help'), } default: return null; @@ -203,4 +203,4 @@ export const selectSnackBar = createSelector( export const selectSnackBarSnacks = createSelector( selectSnackBar, (snackBar) => snackBar.snacks || [] -) \ No newline at end of file +) From 85aa35122ed566fb4cb67669b9f1dca2a1ae8d1d Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 02:27:05 +0200 Subject: [PATCH 06/14] help page trans --- app/locales/en.json | 24 ++++++++++++++++++++++-- ui/js/page/help/view.jsx | 36 ++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 7c4e78d5e..d5eebd356 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -143,5 +143,25 @@ "report": "report", "Content-Type": "Content-Type", "Author": "Author", - "License": "License" -} \ No newline at end of file + "License": "License", + "Read the FAQ": "Read the FAQ", + "Our FAQ answers many common questions.": "Our FAQ answers many common questions.", + "Get Live Help": "Get Live Help", + "Live help is available most hours in the": "Live help is available most hours in the", + "channel of our Slack chat room.": "channel of our Slack chat room.", + "Join Our Slack": "Join Our Slack", + "Report a Bug": "Report a Bug", + "Did you find something wrong?": "Did you find something wrong?", + "Submit a Bug Report": "Submit a Bug Report", + "Thanks! LBRY is made by its users.": "Thanks! LBRY is made by its users.", + "Report": "Report", + "About": "About", + "A newer version of LBRY is available.": "A newer version of LBRY is available.", + "Download LBRY %s now!": "Download LBRY %s now!", + "Your copy of LBRY is up to date.": "Your copy of LBRY is up to date.", + "daemon (lbrynet)": "daemon (lbrynet)", + "wallet (lbryum)": "wallet (lbryum)", + "interface": "interface", + "Platform": "Platform", + "Installation ID": "Installation ID" +} diff --git a/ui/js/page/help/view.jsx b/ui/js/page/help/view.jsx index 3f351adfd..07e03efc4 100644 --- a/ui/js/page/help/view.jsx +++ b/ui/js/page/help/view.jsx @@ -59,62 +59,62 @@ class HelpPage extends React.Component {
-

Read the FAQ

+

{__("Read the FAQ")}

-

Our FAQ answers many common questions.

-

+

{__("Our FAQ answers many common questions.")}

+

-

Get Live Help

+

{__("Get Live Help")}

- Live help is available most hours in the #help channel of our Slack chat room. + {__("Live help is available most hours in the")} #help {__("channel of our Slack chat room.")}

- +

-

Report a Bug

+

{__("Report a Bug")}

-

Did you find something wrong?

-

navigate('report')} label="Submit a Bug Report" icon="icon-bug" button="alt" />

-
Thanks! LBRY is made by its users.
+

{__("Did you find something wrong?")}

+

navigate('report')} label={__("Submit a Bug Report")} icon="icon-bug" button="alt" />

+
{__("Thanks! LBRY is made by its users.")}
{!ver ? null :
-

About

+

{__("About")}

{ver.lbrynet_update_available || ver.lbryum_update_available ? -

A newer version of LBRY is available.

- :

Your copy of LBRY is up to date.

+

{__("A newer version of LBRY is available.")}

+ :

{__("Your copy of LBRY is up to date.")}

} - + - + - + - + - + From 6bd1dccbb8b643479cdf8a8b57b95332872995fa Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 02:38:55 +0200 Subject: [PATCH 07/14] search page translated --- app/locales/en.json | 8 ++++++-- ui/js/page/search/view.jsx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index d5eebd356..80799feeb 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -163,5 +163,9 @@ "wallet (lbryum)": "wallet (lbryum)", "interface": "interface", "Platform": "Platform", - "Installation ID": "Installation ID" -} + "Installation ID": "Installation ID", + "Search Results for": "Search Results for", + "These search results are provided by LBRY, Inc.": "These search results are provided by LBRY, Inc.", + "Exact URL": "Exact URL", + "This is the resolution of a LBRY URL and not controlled by LBRY Inc.": "This is the resolution of a LBRY URL and not controlled by LBRY Inc." +} \ No newline at end of file diff --git a/ui/js/page/search/view.jsx b/ui/js/page/search/view.jsx index 8328434fc..5b28f7b2c 100644 --- a/ui/js/page/search/view.jsx +++ b/ui/js/page/search/view.jsx @@ -17,14 +17,14 @@ class SearchPage extends React.Component{ { lbryuri.isValid(query) ?

- Exact URL

: '' }

- Search Results for {query}

From a000058bf6eac63a2b2e3cf02bf0ae52e6b14ecc Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 08:40:35 +0200 Subject: [PATCH 08/14] page settings, show, wallet, report translated --- app/locales/en.json | 27 ++++++++++++++++++++++++++- ui/js/page/report.js | 16 ++++++++-------- ui/js/page/settings/view.jsx | 32 ++++++++++++++++---------------- ui/js/page/showPage/view.jsx | 6 +++--- ui/js/page/wallet/view.jsx | 2 +- 5 files changed, 54 insertions(+), 29 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 80799feeb..27446956d 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -167,5 +167,30 @@ "Search Results for": "Search Results for", "These search results are provided by LBRY, Inc.": "These search results are provided by LBRY, Inc.", "Exact URL": "Exact URL", - "This is the resolution of a LBRY URL and not controlled by LBRY Inc.": "This is the resolution of a LBRY URL and not controlled by LBRY Inc." + "This is the resolution of a LBRY URL and not controlled by LBRY Inc.": "This is the resolution of a LBRY URL and not controlled by LBRY Inc.", + "Download Directory": "Download Directory", + "LBRY downloads will be saved here.": "LBRY downloads will be saved here.", + "Bandwidth Limits": "Bandwidth Limits", + "Max Upload": "Max Upload", + "Unlimited": "Unlimited", + "Up to": "Up to", + "Max Download": "Max Download", + "Show unavailable content in search results": "Show unavailable content in search results", + "Show NSFW content": "Show NSFW content", + "NSFW content may include nudity, intense sexuality, profanity, or other adult content. By displaying NSFW content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ": "NSFW content may include nudity, intense sexuality, profanity, or other adult content. By displaying NSFW content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ", + "Share Diagnostic Data": "Share Diagnostic Data", + "Help make LBRY better by contributing diagnostic data about my usage": "Help make LBRY better by contributing diagnostic data about my usage", + "Choose limit...": "Choose limit...", + "Loading magic decentralized data...": "Loading magic decentralized data...", + "There's nothing at this location.": "There's nothing at this location.", + "Report an Issue": "Report an Issue", + "Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!": "Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!", + "Description of your issue": "Description of your issue", + "Submit Report": "Submit Report", + "Developer?": "Developer?", + "You can also": "You can also", + "submit an issue on GitHub": "submit an issue on GitHub", + "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.", + "Balance": "Balance" } \ No newline at end of file diff --git a/ui/js/page/report.js b/ui/js/page/report.js index 811adbb04..8d6b259ab 100644 --- a/ui/js/page/report.js +++ b/ui/js/page/report.js @@ -40,25 +40,25 @@ class ReportPage extends React.Component {
-

Report an Issue

-

Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!

+

{__("Report an Issue")}

+

{__("Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!")}

- this._messageArea = t} rows="10" name="message" placeholder="Description of your issue" /> + this._messageArea = t} rows="10" name="message" placeholder={__("Description of your issue")} />
- +
-

Developer?

- You can also . +

{__("Developer?")}

+ {__("You can also")} .
- { this.closeModal(event) }}> - Your bug report has been submitted! Thank you for your feedback. + {__("Your bug report has been submitted! Thank you for your feedback.")}
); diff --git a/ui/js/page/settings/view.jsx b/ui/js/page/settings/view.jsx index d1a4f188c..ea70629ee 100644 --- a/ui/js/page/settings/view.jsx +++ b/ui/js/page/settings/view.jsx @@ -78,7 +78,7 @@ class SettingsPage extends React.Component { } = this.props if (!daemonSettings) { - return
Failed to load settings.
; + return
{__("Failed to load settings.")}
; } /*
@@ -98,33 +98,33 @@ class SettingsPage extends React.Component {
-

Download Directory

+

{__("Download Directory")}

-

Bandwidth Limits

+

{__("Bandwidth Limits")}

-
Max Upload
+
{__("Max Upload")}
{ this.onMaxUploadPrefChange(false) }} defaultChecked={!this.state.isMaxUpload} - label="Unlimited" /> + label={__("Unlimited")} />
{ this.onMaxUploadPrefChange(true) }} defaultChecked={this.state.isMaxUpload} - label={ this.state.isMaxUpload ? 'Up to' : 'Choose limit...' } /> + label={ this.state.isMaxUpload ? __("Up to") : __("Choose limit...") } /> { this.state.isMaxUpload ?
-
Max Download
-
{__("Max Download")}
+ { this.onMaxDownloadPrefChange(false) }} @@ -152,7 +152,7 @@ class SettingsPage extends React.Component { name="max_download_pref" onChange={() => { this.onMaxDownloadPrefChange(true) }} defaultChecked={this.state.isMaxDownload} - label={ this.state.isMaxDownload ? 'Up to' : 'Choose limit...' } /> + label={ this.state.isMaxDownload ? __("Up to") : __("Choose limit...") } /> { this.state.isMaxDownload ?
-

Content

+

{__("Content")}

+ label={__("Show unavailable content in search results")} />
- + helper={__("NSFW content may include nudity, intense sexuality, profanity, or other adult content. By displaying NSFW content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ")} />
-

Share Diagnostic Data

+

{__("Share Diagnostic Data")}

+ label={__("Help make LBRY better by contributing diagnostic data about my usage")} />
diff --git a/ui/js/page/showPage/view.jsx b/ui/js/page/showPage/view.jsx index bab2d4426..633259bea 100644 --- a/ui/js/page/showPage/view.jsx +++ b/ui/js/page/showPage/view.jsx @@ -43,8 +43,8 @@ class ShowPage extends React.Component{

{uri}

- { isResolvingUri && } - { claim === null && There's nothing at this location. } + { isResolvingUri && } + { claim === null && {__("There's nothing at this location.")} }
} @@ -61,4 +61,4 @@ class ShowPage extends React.Component{ } } -export default ShowPage \ No newline at end of file +export default ShowPage diff --git a/ui/js/page/wallet/view.jsx b/ui/js/page/wallet/view.jsx index 4093d003f..a577aa19d 100644 --- a/ui/js/page/wallet/view.jsx +++ b/ui/js/page/wallet/view.jsx @@ -19,7 +19,7 @@ const WalletPage = (props) => {
-

Balance

+

{__("Balance")}

From 0119ed8edc91f31aea819faa5dd171c53f83c180 Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 09:02:37 +0200 Subject: [PATCH 09/14] filaActions and fileCard components translated --- app/locales/en.json | 30 +++++++++++++++++++-- ui/js/component/fileActions/view.jsx | 40 ++++++++++++++-------------- ui/js/component/fileCard/view.jsx | 7 +++-- 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 27446956d..ac594431f 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -192,5 +192,31 @@ "submit an issue on GitHub": "submit an issue on GitHub", "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.", - "Balance": "Balance" -} \ No newline at end of file + "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." +} diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 4924d059d..f72893df1 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -66,7 +66,7 @@ class FileActions extends React.Component { const deleteChecked = this.state.deleteChecked, 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, title = metadata ? metadata.title : uri; @@ -76,7 +76,7 @@ class FileActions extends React.Component { const 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 = {label}; content =
@@ -86,24 +86,24 @@ class FileActions extends React.Component { } else if (!fileInfo && isAvailable === undefined) { - content = + content = } else if (!fileInfo && !isAvailable && !this.state.forceShowActions) { content =
-
Content unavailable.
- {__("Content unavailable.")}
+ - +
} else if (fileInfo === null && !downloading) { - content = { startDownload(uri) } } />; + content = { startDownload(uri) } } />; } else if (fileInfo && fileInfo.download_path) { - content = openInShell(fileInfo)} />; + content = openInShell(fileInfo)} />; } else { console.log('handle this case of file action props?'); console.log(this.props) @@ -115,29 +115,29 @@ class FileActions extends React.Component { { showMenu ? openInFolder(fileInfo)} label={openInFolderMessage} /> - openModal('confirmRemove')} label="Remove..." /> + openModal('confirmRemove')} label={__("Remove...")} /> : '' } - This will purchase {title} for credits. + contentLabel={__("Confirm Purchase")} onConfirmed={this.onAffirmPurchase.bind(this)} onAborted={this.props.closeModal}> + {__("This will purchase")} {title} {__("for")} {__("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.")} - - LBRY was unable to download the stream {uri}. + {__("LBRY was unable to download the stream")} {uri}. deleteFile(fileInfo.outpoint, deleteChecked)} onAborted={closeModal}> -

Are you sure you'd like to remove {title} from LBRY?

+

{__("Are you sure you'd like to remove")} {title} {__("from LBRY?")}

- +
); diff --git a/ui/js/component/fileCard/view.jsx b/ui/js/component/fileCard/view.jsx index 918476a53..d333c03c9 100644 --- a/ui/js/component/fileCard/view.jsx +++ b/ui/js/component/fileCard/view.jsx @@ -68,11 +68,11 @@ class FileCard extends React.Component { let description = "" if (isResolvingUri) { - description = "Loading..." + description = __("Loading...") } else if (metadata && metadata.description) { description = metadata.description } else if (claim === null) { - description = 'This address contains no content.' + description = __("This address contains no content.") } return ( @@ -99,8 +99,7 @@ class FileCard extends React.Component { {obscureNsfw && this.state.hovered ?

- This content is Not Safe For Work. - To view adult content, please change your navigate('settings')} label="Settings" />. + {__("This content is Not Safe For Work. To view adult content, please change your")} navigate('settings')} label={__("Settings")} />.

: null} From 73e7419bf29062037f0acc14a7e3cd9254180648 Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 15:55:59 +0200 Subject: [PATCH 10/14] fileList component translated --- app/locales/en.json | 7 +++++-- ui/js/component/fileList/view.jsx | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index ac594431f..e99a342a3 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -218,5 +218,8 @@ "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." -} + "This address contains no content.": "This address contains no content.", + "Sort by": "Sort by", + "Date": "Date", + "File name": "File name" +} \ No newline at end of file diff --git a/ui/js/component/fileList/view.jsx b/ui/js/component/fileList/view.jsx index eb3b620b8..cd85a7b84 100644 --- a/ui/js/component/fileList/view.jsx +++ b/ui/js/component/fileList/view.jsx @@ -77,11 +77,11 @@ class FileList extends React.Component {
{ fetching && } - Sort by { ' ' } + {__("Sort by")} { ' ' } - - - + + + {content} From 9ba4da4032e69ff2447f361ceb20df74ce020ff7 Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 16:13:16 +0200 Subject: [PATCH 11/14] fileListSearch and fileTitle component translated --- app/locales/en.json | 8 +++++++- ui/js/component/fileListSearch/view.jsx | 10 +++++----- ui/js/component/fileTile/view.jsx | 11 +++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index e99a342a3..d0ad9cd54 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -221,5 +221,11 @@ "This address contains no content.": "This address contains no content.", "Sort by": "Sort by", "Date": "Date", - "File name": "File name" + "File name": "File name", + "Looking up the Dewey Decimals": "Looking up the Dewey Decimals", + "No one has checked anything in for %s yet.": "No one has checked anything in for %s yet.", + "Be the first": "Be the first", + "Refreshing the Dewey Decimals": "Refreshing the Dewey Decimals", + "This location is unused.": "This location is unused.", + "Put something here!": "Put something here!" } \ No newline at end of file diff --git a/ui/js/component/fileListSearch/view.jsx b/ui/js/component/fileListSearch/view.jsx index 986d8aa5c..7666c54fc 100644 --- a/ui/js/component/fileListSearch/view.jsx +++ b/ui/js/component/fileListSearch/view.jsx @@ -16,8 +16,8 @@ const SearchNoResults = (props) => { return
- No one has checked anything in for {query} yet. { ' ' } - navigate('/publish')} /> + {__("No one has checked anything in for %s yet."), query} { ' ' } + navigate('/publish')} />
; } @@ -60,10 +60,10 @@ class FileListSearch extends React.Component{ return (
{isSearching && !results && - } + } {isSearching && results && - } + } {(results && !!results.length) ? : @@ -73,4 +73,4 @@ class FileListSearch extends React.Component{ } } -export default FileListSearch \ No newline at end of file +export default FileListSearch diff --git a/ui/js/component/fileTile/view.jsx b/ui/js/component/fileTile/view.jsx index 250bf6296..610ad2d28 100644 --- a/ui/js/component/fileTile/view.jsx +++ b/ui/js/component/fileTile/view.jsx @@ -68,15 +68,15 @@ class FileTile extends React.Component { if (isClaimed) { description = metadata && metadata.description } else if (isResolvingUri) { - description = "Loading..." + description = __("Loading...") } else if (showEmpty === FileTile.SHOW_EMPTY_PUBLISH) { onClick = () => navigate('/publish', { }) description = - This location is unused. { ' ' } - { isClaimable && Put something here! } + {__("This location is unused.")} { ' ' } + { isClaimable && {__("Put something here!")} } } else if (showEmpty === FileTile.SHOW_EMPTY_PENDING) { - description = This file is pending confirmation. + description = {__("This file is pending confirmation.")} } return ( @@ -103,8 +103,7 @@ class FileTile extends React.Component { {this.state.showNsfwHelp ?

- This content is Not Safe For Work. - To view adult content, please change your navigate('/settings')} label="Settings" />. + {__("This content is Not Safe For Work. To view adult content, please change your")} navigate('/settings')} label={__("Settings")} />.

: null} From c5df0875045e5f0f9e6949a84aec8c3676f235b5 Mon Sep 17 00:00:00 2001 From: Intnick Date: Fri, 26 May 2017 16:19:49 +0200 Subject: [PATCH 12/14] header and tranactionList component translated --- app/locales/en.json | 8 +++++++- ui/js/component/header/view.jsx | 2 +- ui/js/component/transactionList/view.jsx | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index d0ad9cd54..04947c1b9 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -227,5 +227,11 @@ "Be the first": "Be the first", "Refreshing the Dewey Decimals": "Refreshing the Dewey Decimals", "This location is unused.": "This location is unused.", - "Put something here!": "Put something here!" + "Put something here!": "Put something here!", + "Transaction History": "Transaction History", + "You have no transactions.": "You have no transactions.", + "Loading transactions": "Loading transactions", + "Amount": "Amount", + "Time": "Time", + "Transaction": "Transaction" } \ No newline at end of file diff --git a/ui/js/component/header/view.jsx b/ui/js/component/header/view.jsx index 68328feb9..32d15501a 100644 --- a/ui/js/component/header/view.jsx +++ b/ui/js/component/header/view.jsx @@ -23,7 +23,7 @@ export const Header = (props) => { navigate('/wallet')} button="text" icon="icon-bank" label={balance} >
- navigate('/publish')} button="primary button--flat" icon="icon-upload" label="Publish" /> + navigate('/publish')} button="primary button--flat" icon="icon-upload" label={__("Publish")} />
navigate('/downloaded')} button="alt button--flat" icon="icon-folder" /> diff --git a/ui/js/component/transactionList/view.jsx b/ui/js/component/transactionList/view.jsx index 5d92e2b68..3da32a13d 100644 --- a/ui/js/component/transactionList/view.jsx +++ b/ui/js/component/transactionList/view.jsx @@ -22,8 +22,8 @@ class TransactionList extends React.Component{ rows.push(
- - + + @@ -35,19 +35,19 @@ class TransactionList extends React.Component{ return (
-

Transaction History

+

{__("Transaction History")}

- { fetchingTransactions && } - { !fetchingTransactions && rows.length === 0 ?
You have no transactions.
: '' } + { fetchingTransactions && } + { !fetchingTransactions && rows.length === 0 ?
{__("You have no transactions.")}
: '' } { rows.length > 0 ?
daemon (lbrynet){__("daemon (lbrynet)")} {ver.lbrynet_version}
wallet (lbryum){__("wallet (lbryum)")} {ver.lbryum_version}
interface{__("interface")} {uiVersion}
Platform{__("Platform")} {platform}
Installation ID{__("Installation ID")} {this.state.lbryId}
{ (item.amount > 0 ? '+' : '' ) + item.amount }{ item.date ? item.date.toLocaleDateString() : (Transaction pending) }{ item.date ? item.date.toLocaleTimeString() : (Transaction pending) }{ item.date ? item.date.toLocaleDateString() : {__("(Transaction pending)")} }{ item.date ? item.date.toLocaleTimeString() : {__("(Transaction pending)")} } {item.id.substr(0, 7)}
- - - - + + + + @@ -62,4 +62,4 @@ class TransactionList extends React.Component{ } } -export default TransactionList \ No newline at end of file +export default TransactionList From dbb118c8ee3313ae3c2036449700c687a59a7cab Mon Sep 17 00:00:00 2001 From: Mayesters Date: Fri, 26 May 2017 17:30:18 +0200 Subject: [PATCH 13/14] Fix small error in merge master -> i18n --- ui/js/page/help/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/js/page/help/view.jsx b/ui/js/page/help/view.jsx index 9d4d49e46..81c889463 100644 --- a/ui/js/page/help/view.jsx +++ b/ui/js/page/help/view.jsx @@ -99,7 +99,7 @@ class HelpPage extends React.Component { {this.state.appVersionInfo ? (ver.lbrynet_update_available || ver.lbryum_update_available ?

{__("A newer version of LBRY is available.")}

- :

{__("Your copy of LBRY is up to date.")}

+ :

{__("Your copy of LBRY is up to date.")}

) : null} { ver ?
AmountDateTimeTransaction{__("Amount")}{__("Date")}{__("Time")}{__("Transaction")}
From 01cb3f583ee7f32231f5bf9af551c424b722581a Mon Sep 17 00:00:00 2001 From: Mayesters Date: Fri, 26 May 2017 22:26:06 +0200 Subject: [PATCH 14/14] lots of stuff translated --- app/locales/en.json | 74 +++++++++++++++++++++++++- ui/js/component/upgradeModal/view.jsx | 8 +-- ui/js/component/video/view.jsx | 16 +++--- ui/js/component/walletAddress/view.jsx | 8 +-- ui/js/component/walletSend/view.jsx | 20 +++---- ui/js/jsonrpc.js | 4 +- ui/js/lbry.js | 4 +- ui/js/lbryio.js | 12 ++--- ui/js/lbryuri.js | 28 +++++----- ui/js/lighthouse.js | 2 +- ui/js/page/developer.js | 2 +- ui/js/page/rewards.js | 6 +-- ui/js/rewards.js | 24 ++++----- 13 files changed, 140 insertions(+), 68 deletions(-) diff --git a/app/locales/en.json b/app/locales/en.json index 04947c1b9..acf9f743f 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -233,5 +233,77 @@ "Loading transactions": "Loading transactions", "Amount": "Amount", "Time": "Time", - "Transaction": "Transaction" + "Transaction": "Transaction", + "You earned %s for registering as a new developer.": "You earned %s for registering as a new developer.", + "You earned %s LBC new user reward.": "You earned %s LBC new user reward.", + "You earned %s LBC for verifying your email address.": "You earned %s LBC for verifying your email address.", + "You earned %s LBC for creating a publisher identity.": "You earned %s LBC for creating a publisher identity.", + "You earned %s LBC for streaming your first video.": "You earned %s LBC for streaming your first video.", + "You earned %s LBC for downloading some of the things.": "You earned %s LBC for downloading some of the things.", + "You earned %s LBC for making your first publication.": "You earned %s LBC for making your first publication.", + "Your First Nickel": "Your First Nickel", + "First Publish": "First Publish", + "We're Going Streaming": "We're Going Streaming", + "Channel Surfing": "Channel Surfing", + "Many Views": "Many Views", + "Hot Right Now": "Hot Right Now", + "A welcome bonus for being at the vanguard of content freedom.": "A welcome bonus for being at the vanguard of content freedom.", + "The first view is on us.": "The first view is on us.", + "Up the quad, and to the gymanasium. Press play. Everybody's doing it.": "Up the quad, and to the gymanasium. Press play. Everybody's doing it.", + "Claim your channel! Create an identity used to securely publish content.": "Claim your channel! Create an identity used to securely publish content.", + "Watch a bunch of stuff... who knows how much?": "Watch a bunch of stuff... who knows how much?", + "Watch the latest featured content.": "Watch the latest featured content.", + "Rewards are not enabled.": "Rewards are not enabled.", + "Failed to load rewards.": "Failed to load rewards.", + "Reward claimed.": "Reward claimed.", + "Show All": "Show All", + "Please create a channel identity first.": "Please create a channel identity first.", + "Please publish something and wait for confirmation by the network to claim this reward.": "Please publish something and wait for confirmation by the network to claim this reward.", + "Please publish something to claim this reward.": "Please publish something to claim this reward.", + "Could not connect to Lighthouse server. Last server attempted: %s": "Could not connect to Lighthouse server. Last server attempted: %s", + "LBRY URIs must include a protocol prefix (lbry://).": "LBRY URIs must include a protocol prefix (lbry://).", + "URI does not include name.": "URI does not include name.", + "No channel name after @.": "No channel name after @.", + "Channel names must be at least %s characters.": "Channel names must be at least %s characters.", + "Invalid character %s in name: %s.": "Invalid character %s in name: %s.", + "No modifier provided after separator %s.": "No modifier provided after separator %s.", + "Invalid claim ID %s.": "Invalid claim ID %s.", + "Claim sequence must be a number.": "Claim sequence must be a number.", + "Bid position must be a number.": "Bid position must be a number.", + "Only channel URIs may have a path.": "Only channel URIs may have a path.", + "Invalid character %s in path: %s": "Invalid character %s in path: %s", + "No path provided after /": "No path provided after /", + "Received a channel content URI, but name and channelName do not match. \"name\" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.": "Received a channel content URI, but name and channelName do not match. \"name\" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.", + "Path and contentName do not match. Only one is required; most likely you wanted contentName.": "Path and contentName do not match. Only one is required; most likely you wanted contentName.", + "Internal API disabled": "Internal API disabled", + "LBRY internal API is disabled": "LBRY internal API is disabled", + "Something went wrong making an internal API call.": "Something went wrong making an internal API call.", + "XMLHttpRequest connection timed out": "XMLHttpRequest connection timed out", + "Invalid method": "Invalid method", + "Received invalid authentication response.": "Received invalid authentication response.", + "Unable to connect to LBRY": "Unable to connect to LBRY", + "Resolve has hacked cache on top of it that requires a URI": "Resolve has hacked cache on top of it that requires a URI", + "Connection to API server failed": "Connection to API server failed", + "Please select a file to upgrade from": "Please select a file to upgrade from", + "Update available": "Update available", + "Upgrade": "Upgrade", + "Skip": "Skip", + "Your version of LBRY is out of date and may be unreliable or insecure.": "Your version of LBRY is out of date and may be unreliable or insecure.", + "Sorry, your download timed out :(": "Sorry, your download timed out :(", + "Requesting stream... it may sit here for like 15-20 seconds in a really awkward way... we're working on it": "Requesting stream... it may sit here for like 15-20 seconds in a really awkward way... we're working on it", + "Downloading stream... not long left now!": "Downloading stream... not long left now!", + "this is the world's worst loading screen and we shipped our software with it anyway...": "this is the world's worst loading screen and we shipped our software with it anyway...", + "Wallet Address": "Wallet Address", + "Get New Address": "Get New Address", + "Other LBRY users may send credits to you by entering this address on the \"Send\" page.": "Other LBRY users may send credits to you by entering this address on the \"Send\" page.", + "You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.": "You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.", + "Send Credits": "Send Credits", + "Recipient Address": "Recipient Address", + "Insufficient balance": "Insufficient balance", + "Insufficient balance: after this transaction you would have less than 1 LBC in your wallet.": "Insufficient balance: after this transaction you would have less than 1 LBC in your wallet.", + "Transaction successful": "Transaction successful", + "Your transaction was successfully placed in the queue.": "Your transaction was successfully placed in the queue.", + "Transaction failed": "Transaction failed", + "Something went wrong": "Something went wrong", + "Find movies, music, games, and more": "Find movies, music, games, and more" } \ No newline at end of file diff --git a/ui/js/component/upgradeModal/view.jsx b/ui/js/component/upgradeModal/view.jsx index a2a181c79..cd18253b2 100644 --- a/ui/js/component/upgradeModal/view.jsx +++ b/ui/js/component/upgradeModal/view.jsx @@ -17,13 +17,13 @@ class UpgradeModal extends React.Component { return ( - Your version of LBRY is out of date and may be unreliable or insecure. + {__("Your version of LBRY is out of date and may be unreliable or insecure.")} ) } diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index 081396cab..2ff93b9bc 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -51,20 +51,20 @@ class VideoPlayButton extends React.Component { icon="icon-play" onClick={this.onWatchClick.bind(this)} /> {modal} - { this.closeModal() }}> - You don't have enough LBRY credits to pay for this stream. + { this.closeModal() }}> + {__("You don't have enough LBRY credits to pay for this stream.")} - This will purchase {title} for credits. + {__("This will purchase")} {title} {__("for")} {__("credits")}. { this.closeModal() }} contentLabel="Timed Out"> - Sorry, your download timed out :( + {__("Sorry, your download timed out :(")} ); } @@ -100,16 +100,16 @@ class Video extends React.Component { let loadStatusMessage = '' if (isLoading) { - loadStatusMessage = "Requesting stream... it may sit here for like 15-20 seconds in a really awkward way... we're working on it" + loadStatusMessage = __("Requesting stream... it may sit here for like 15-20 seconds in a really awkward way... we're working on it") } else if (isDownloading) { - loadStatusMessage = "Downloading stream... not long left now!" + loadStatusMessage = __("Downloading stream... not long left now!") } return (
{ isPlaying || isLoading ? (!isReadyToPlay ? - this is the world's worst loading screen and we shipped our software with it anyway...

{loadStatusMessage}
: + {__("this is the world's worst loading screen and we shipped our software with it anyway...")}

{loadStatusMessage}
: ) :
diff --git a/ui/js/component/walletAddress/view.jsx b/ui/js/component/walletAddress/view.jsx index 76227786a..464ee037f 100644 --- a/ui/js/component/walletAddress/view.jsx +++ b/ui/js/component/walletAddress/view.jsx @@ -19,18 +19,18 @@ class WalletAddress extends React.Component { return (
-

Wallet Address

+

{__("Wallet Address")}

- +
-

Other LBRY users may send credits to you by entering this address on the "Send" page.

-

You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.

+

{__("Other LBRY users may send credits to you by entering this address on the \"Send\" page.")}

+

{__("You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.")}

diff --git a/ui/js/component/walletSend/view.jsx b/ui/js/component/walletSend/view.jsx index 60e7c6126..5e05a946e 100644 --- a/ui/js/component/walletSend/view.jsx +++ b/ui/js/component/walletSend/view.jsx @@ -20,27 +20,27 @@ const WalletSend = (props) => {
-

Send Credits

+

{__("Send Credits")}

- +
- +
- 0.0) || !address} /> + 0.0) || !address} />
- {modal == 'insufficientBalance' && - Insufficient balance: after this transaction you would have less than 1 LBC in your wallet. + {modal == 'insufficientBalance' && + {__("Insufficient balance: after this transaction you would have less than 1 LBC in your wallet.")} } - {modal == 'transactionSuccessful' && - Your transaction was successfully placed in the queue. + {modal == 'transactionSuccessful' && + {__("Your transaction was successfully placed in the queue.")} } - {modal == 'transactionFailed' && - Something went wrong: + {modal == 'transactionFailed' && + {__("Something went wrong")}: }
) diff --git a/ui/js/jsonrpc.js b/ui/js/jsonrpc.js index 378e850a2..d4822fa46 100644 --- a/ui/js/jsonrpc.js +++ b/ui/js/jsonrpc.js @@ -11,7 +11,7 @@ jsonrpc.call = function (connectionString, method, params, callback, errorCallba connectFailedCallback(e); }); xhr.addEventListener('timeout', function() { - connectFailedCallback(new Error('XMLHttpRequest connection timed out')); + connectFailedCallback(new Error(__('XMLHttpRequest connection timed out'))); }) } xhr.addEventListener('load', function() { @@ -50,7 +50,7 @@ jsonrpc.call = function (connectionString, method, params, callback, errorCallba method: method, params: params, code: xhr.status, - message: 'Connection to API server failed' + message: __('Connection to API server failed') } }); document.dispatchEvent(errorEvent); diff --git a/ui/js/lbry.js b/ui/js/lbry.js index b9230ce16..0be9f5ef1 100644 --- a/ui/js/lbry.js +++ b/ui/js/lbry.js @@ -111,7 +111,7 @@ lbry.connect = function() { }, tryNum < 100 ? 200 : 1000); } else { - reject(new Error("Unable to connect to LBRY")); + reject(new Error(__("Unable to connect to LBRY"))); } } }); @@ -422,7 +422,7 @@ lbry._resolveXhrs = {} lbry.resolve = function(params={}) { return new Promise((resolve, reject) => { if (!params.uri) { - throw "Resolve has hacked cache on top of it that requires a URI" + throw __("Resolve has hacked cache on top of it that requires a URI") } if (params.uri && lbry._claimCache[params.uri] !== undefined) { resolve(lbry._claimCache[params.uri]); diff --git a/ui/js/lbryio.js b/ui/js/lbryio.js index 9d78cfb82..c00252921 100644 --- a/ui/js/lbryio.js +++ b/ui/js/lbryio.js @@ -34,20 +34,20 @@ lbryio.getExchangeRates = function() { lbryio.call = function(resource, action, params={}, method='get', evenIfDisabled=false) { // evenIfDisabled is just for development, when we may have some calls working and some not return new Promise((resolve, reject) => { if (!lbryio.enabled && !evenIfDisabled && (resource != 'discover' || action != 'list')) { - console.log("Internal API disabled"); - reject(new Error("LBRY internal API is disabled")) + console.log(__("Internal API disabled")); + reject(new Error(__("LBRY internal API is disabled"))) return } const xhr = new XMLHttpRequest; xhr.addEventListener('error', function (event) { - reject(new Error("Something went wrong making an internal API call.")); + reject(new Error(__("Something went wrong making an internal API call."))); }); xhr.addEventListener('timeout', function() { - reject(new Error('XMLHttpRequest connection timed out')); + reject(new Error(__('XMLHttpRequest connection timed out'))); }); xhr.addEventListener('load', function() { @@ -89,7 +89,7 @@ lbryio.call = function(resource, action, params={}, method='get', evenIfDisabled xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.send(querystring.stringify(fullParams)); } else { - reject(new Error("Invalid method")); + reject(new Error(__("Invalid method"))); } }); }; @@ -138,7 +138,7 @@ lbryio.authenticate = function() { app_id: installation_id, }, 'post').then(function(responseData) { if (!responseData.id) { - reject(new Error("Received invalid authentication response.")); + reject(new Error(__("Received invalid authentication response."))); } lbryio.setAccessToken(installation_id) setCurrentUser() diff --git a/ui/js/lbryuri.js b/ui/js/lbryuri.js index 680c42d65..bc1749b71 100644 --- a/ui/js/lbryuri.js +++ b/ui/js/lbryuri.js @@ -39,12 +39,12 @@ lbryuri.parse = function(uri, requireProto=false) { // Validate protocol if (requireProto && !proto) { - throw new Error('LBRY URIs must include a protocol prefix (lbry://).'); + throw new Error(__('LBRY URIs must include a protocol prefix (lbry://).')); } // Validate and process name if (!name) { - throw new Error('URI does not include name.'); + throw new Error(__('URI does not include name.')); } const isChannel = name.startsWith('@'); @@ -52,11 +52,11 @@ lbryuri.parse = function(uri, requireProto=false) { if (isChannel) { if (!channelName) { - throw new Error('No channel name after @.'); + throw new Error(__('No channel name after @.')); } if (channelName.length < CHANNEL_NAME_MIN_LEN) { - throw new Error(`Channel names must be at least ${CHANNEL_NAME_MIN_LEN} characters.`); + throw new Error(__(`Channel names must be at least %s characters.`, CHANNEL_NAME_MIN_LEN)); } contentName = path; @@ -64,14 +64,14 @@ lbryuri.parse = function(uri, requireProto=false) { const nameBadChars = (channelName || name).match(/[^A-Za-z0-9-]/g); if (nameBadChars) { - throw new Error(`Invalid character${nameBadChars.length == 1 ? '' : 's'} in name: ${nameBadChars.join(', ')}.`); + throw new Error(__(`Invalid character %s in name: %s.`, nameBadChars.length == 1 ? '' : 's', nameBadChars.join(', ') )); } // Validate and process modifier (claim ID, bid position or claim sequence) let claimId, claimSequence, bidPosition; if (modSep) { if (!modVal) { - throw new Error(`No modifier provided after separator ${modSep}.`); + throw new Error(__(`No modifier provided after separator %s.`, modSep)); } if (modSep == '#') { @@ -84,31 +84,31 @@ lbryuri.parse = function(uri, requireProto=false) { } if (claimId && (claimId.length > CLAIM_ID_MAX_LEN || !claimId.match(/^[0-9a-f]+$/))) { - throw new Error(`Invalid claim ID ${claimId}.`); + throw new Error(__(`Invalid claim ID %s.`, claimId)); } if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) { - throw new Error('Claim sequence must be a number.'); + throw new Error(__('Claim sequence must be a number.')); } if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) { - throw new Error('Bid position must be a number.'); + throw new Error(__('Bid position must be a number.')); } // Validate and process path if (path) { if (!isChannel) { - throw new Error('Only channel URIs may have a path.'); + throw new Error(__('Only channel URIs may have a path.')); } const pathBadChars = path.match(/[^A-Za-z0-9-]/g); if (pathBadChars) { - throw new Error(`Invalid character${count == 1 ? '' : 's'} in path: ${nameBadChars.join(', ')}`); + throw new Error(__(`Invalid character %s in path: %s`,count == 1 ? '' : 's',nameBadChars.join(', '))); } contentName = path; } else if (pathSep) { - throw new Error('No path provided after /'); + throw new Error(__('No path provided after /')); } return { @@ -135,7 +135,7 @@ lbryuri.build = function(uriObj, includeProto=true, allowExtraProps=false) { if (!name) { name = channelNameFormatted; } else if (name !== channelNameFormatted) { - throw new Error('Received a channel content URI, but name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.'); + throw new Error(__('Received a channel content URI, but name and channelName do not match. \"name\" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.')); } } @@ -146,7 +146,7 @@ lbryuri.build = function(uriObj, includeProto=true, allowExtraProps=false) { path = contentName; } if (path && path !== contentName) { - throw new Error('path and contentName do not match. Only one is required; most likely you wanted contentName.'); + throw new Error(__('Path and contentName do not match. Only one is required; most likely you wanted contentName.')); } } diff --git a/ui/js/lighthouse.js b/ui/js/lighthouse.js index 5ca4ef038..c72338d64 100644 --- a/ui/js/lighthouse.js +++ b/ui/js/lighthouse.js @@ -21,7 +21,7 @@ function getServers() { function call(method, params, callback, errorCallback) { if (connectTryNum >= maxQueryTries) { - errorCallback(new Error(`Could not connect to Lighthouse server. Last server attempted: ${server}`)); + errorCallback(new Error(__(`Could not connect to Lighthouse server. Last server attempted: %s`, server))); return; } diff --git a/ui/js/page/developer.js b/ui/js/page/developer.js index 4ac1a133b..ec41baeb7 100644 --- a/ui/js/page/developer.js +++ b/ui/js/page/developer.js @@ -42,7 +42,7 @@ class DeveloperPage extends React.Component { handleForceUpgradeClick() { let upgradeSent = false; if (!this.state.upgradePath) { - alert('Please select a file to upgrade from'); + alert(__('Please select a file to upgrade from')); } else { try { const stats = fs.lstatSync(this.state.upgradePath); diff --git a/ui/js/page/rewards.js b/ui/js/page/rewards.js index 9c0e9ad8f..41645dd15 100644 --- a/ui/js/page/rewards.js +++ b/ui/js/page/rewards.js @@ -24,7 +24,7 @@ export class RewardTile extends React.Component {
{this.props.claimed - ? Reward claimed. + ? {__("Reward claimed.")} : }
{this.props.description}
@@ -64,9 +64,9 @@ export class RewardsPage extends React.Component {
{!this.state.userRewards - ? (this.state.failed ?
Failed to load rewards.
: '') + ? (this.state.failed ?
{__("Failed to load rewards.")}
: '') : this.state.userRewards.map(({reward_type, reward_title, reward_description, transaction_id, reward_amount}) => { - return ; + return ; })}
diff --git a/ui/js/rewards.js b/ui/js/rewards.js index a77ccde01..6e08ca11d 100644 --- a/ui/js/rewards.js +++ b/ui/js/rewards.js @@ -7,13 +7,13 @@ import { function rewardMessage(type, amount) { return { - new_developer: `You earned ${amount} for registering as a new developer.`, - new_user: `You earned ${amount} LBC new user reward.`, - confirm_email: `You earned ${amount} LBC for verifying your email address.`, - new_channel: `You earned ${amount} LBC for creating a publisher identity.`, - first_stream: `You earned ${amount} LBC for streaming your first video.`, - many_downloads: `You earned ${amount} LBC for downloading some of the things.`, - first_publish: `You earned ${amount} LBC for making your first publication.`, + new_developer: __(`You earned %s for registering as a new developer.`, amount), + new_user: __(`You earned %s LBC new user reward.`, amount), + confirm_email: __(`You earned %s LBC for verifying your email address.`, amount), + new_channel: __(`You earned %s LBC for creating a publisher identity.`, amount), + first_stream: __(`You earned %s LBC for streaming your first video.`, amount), + many_downloads: __(`You earned %s LBC for downloading some of the things.`, amount), + first_publish: __(`You earned %s LBC for making your first publication.`, amount), }[type]; } @@ -81,7 +81,7 @@ rewards.claimReward = function (type) { function requestReward(resolve, reject, params) { if (!lbryio.enabled) { - reject(new Error("Rewards are not enabled.")) + reject(new Error(__("Rewards are not enabled."))) return; } lbryio.call('reward', 'new', params, 'post').then(({reward_amount}) => { @@ -96,7 +96,7 @@ rewards.claimReward = function (type) { // Display global notice const action = doShowSnackBar({ message, - linkText: "Show All", + linkText: __("Show All"), linkTarget: "/rewards", isError: false, }) @@ -125,7 +125,7 @@ rewards.claimReward = function (type) { params.transaction_id = claim.txid; requestReward(resolve, reject, params) } else { - reject(new Error("Please create a channel identity first.")) + reject(new Error(__("Please create a channel identity first."))) } }).catch(reject) break; @@ -140,8 +140,8 @@ rewards.claimReward = function (type) { requestReward(resolve, reject, params) } else { reject(claims.length ? - new Error("Please publish something and wait for confirmation by the network to claim this reward.") : - new Error("Please publish something to claim this reward.")) + new Error(__("Please publish something and wait for confirmation by the network to claim this reward.")) : + new Error(__("Please publish something to claim this reward."))) } }).catch(reject) break;