diff --git a/README.md b/README.md index b9196bc28..e446b747a 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,7 @@ to create distributable packages, which is run by calling: This project has currently only been worked on in Linux and macOS. If you are on Windows, you can checkout out the build steps in [appveyor.yml](https://github.com/lbryio/lbry-app/blob/master/.appveyor.yml) and probably figure out something from there. + +## Internationalization + +If you want to help translating the lbry-app, you can copy the en.json file in /app/locales and modify the values while leaving the keys as their original English strings. An example for this would be: `"Skip": "Überspringen",` Translations should automatically show up in options. \ No newline at end of file diff --git a/app/locales/en.json b/app/locales/en.json new file mode 100644 index 000000000..3587a1417 --- /dev/null +++ b/app/locales/en.json @@ -0,0 +1,320 @@ +{ + "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?", + "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", + "credit": "credit", + "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", + "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", + "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.", + "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", + "Open in Folder": "Open in Folder", + "Checking availability": "Checking availability", + "Confirm Purchase": "Confirm Purchase", + "This will purchase": "This will purchase", + "for": "for", + "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.", + "Sort by": "Sort by", + "Date": "Date", + "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!", + "Transaction History": "Transaction History", + "You have no transactions.": "You have no transactions.", + "Loading transactions": "Loading transactions", + "Amount": "Amount", + "Time": "Time", + "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", + "Wallet": "Wallet", + "Looking up version info": "Looking up version info", + "It looks like you deleted or moved this file. We're rebuilding it now. It will only take a few seconds.": "It looks like you deleted or moved this file. We're rebuilding it now. It will only take a few seconds.", + "Fetching cost info": "Fetching cost info", + "Testing network": "Testing network", + "Connection Failure": "Connection Failure", + "Try closing all LBRY processes and starting again. If this still happpens, your anti-virus software or firewall may be preventing LBRY from connecting. Contact hello@lbry.io if you think this is a software bug.": "Try closing all LBRY processes and starting again. If this still happpens, your anti-virus software or firewall may be preventing LBRY from connecting. Contact hello@lbry.io if you think this is a software bug.", + "Timed Out": "Timed Out", + "Testing Network": "Testing Network", + "This email is already in use": "This email is already in use", + "Download now!": "Download now!" +} \ No newline at end of file diff --git a/app/locales/rs.json b/app/locales/rs.json new file mode 100644 index 000000000..ebac8ca19 --- /dev/null +++ b/app/locales/rs.json @@ -0,0 +1,311 @@ +{ + "Edit": "RS_Edit", + "Help": "RS_Help", + "Developer": "RS_Developer", + "Reload": "RS_Reload", + "Toggle Developer Tools": "RS_Toggle Developer Tools", + "Inspect Element": "RS_Inspect Element", + "connectionString": "RS_connectionString", + "Method": "RS_Method", + "Parameters": "RS_Parameters", + "Error code": "RS_Error code", + "Error message": "RS_Error message", + "Error data": "RS_Error data", + "Home": "RS_Home", + "Publish": "RS_Publish", + "This LBC remains yours and the deposit can be undone at any time.": "RS_This LBC remains yours and the deposit can be undone at any time.", + "Content": "RS_Content", + "What are you publishing?": "RS_What are you publishing?", + "Access": "RS_Access", + "Select a URL for this publish.": "RS_Select a URL for this publish.", + "How much does this content cost?": "RS_How much does this content cost?", + "Price": "RS_Price", + "Free": "RS_Free", + "Choose price...": "RS_Choose price...", + "US Dollars": "RS_US Dollars", + "LBRY credits": "RS_LBRY credits", + "Public Domain": "RS_Public Domain", + "Creative Commons Attribution 4.0 International": "RS_Creative Commons Attribution 4.0 International", + "Creative Commons Attribution-ShareAlike 4.0 International": "RS_Creative Commons Attribution-ShareAlike 4.0 International", + "Creative Commons Attribution-NoDerivatives 4.0 International": "RS_Creative Commons Attribution-NoDerivatives 4.0 International", + "Creative Commons Attribution-NonCommercial 4.0 International": "RS_Creative Commons Attribution-NonCommercial 4.0 International", + "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International": "RS_Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", + "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International": "RS_Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International", + "Copyrighted...": "RS_Copyrighted...", + "Other...": "RS_Other...", + "Identity": "RS_Identity", + "Who created this content?": "RS_Who created this content?", + "Anonymous": "RS_Anonymous", + "New identity...": "RS_New identity...", + "Address": "RS_Address", + "Where should this content permanently reside?": "RS_Where should this content permanently reside?", + "Read more": "RS_Read more", + "Terms of Service": "RS_Terms of Service", + "Deposit": "RS_Deposit", + "This URL is unused.": "RS_This URL is unused.", + "LBRY names must contain only letters, numbers and dashes.": "RS_LBRY names must contain only letters, numbers and dashes.", + "Title": "RS_Title", + "Thumbnail URL": "RS_Thumbnail URL", + "Description": "RS_Description", + "Description of your content": "RS_Description of your content", + "Language": "RS_Language", + "English": "RS_English", + "Chinese": "RS_Chinese", + "French": "RS_French", + "German": "RS_German", + "Japanese": "RS_Japanese", + "Russian": "RS_Russian", + "Spanish": "RS_Spanish", + "Maturity": "RS_Maturity", + "All Ages": "RS_All Ages", + "Adults Only": "RS_Adults Only", + "Cancel": "RS_Cancel", + "File published": "RS_File published", + "I agree to the": "RS_I agree to the", + "LBRY terms of service": "RS_LBRY terms of service", + "Your file has been published to LBRY at the address": "RS_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.": "RS_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": "RS_Error publishing file", + "The following error occurred when attempting to publish your file": "RS_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": "RS_A deposit of at least \"%s\" credit is required to win \"%s\". However, you can still get a permanent URL for any amount.", + "other": "RS_A deposit of at least \"%s\" credits is required to win \"%s\". However, you can still get a permanent URL for any amount." + }, + "Connecting": "RS_Connecting", + "Discover": "RS_Discover", + "Fetching content": "RS_Fetching content", + "What's this?": "RS_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!": "RS_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": "RS_LBRY is Closed", + "Click here to start LBRY": "RS_Click here to start LBRY", + "Failed to load landing content.": "RS_Failed to load landing content.", + "Settings": "RS_Settings", + "Welcome to LBRY": "RS_Welcome to LBRY", + "Downloads & Purchases": "RS_Downloads & Purchases", + "Downloaded": "RS_Downloaded", + "Published": "RS_Published", + "Publishes": "RS_Publishes", + "Overview": "RS_Overview", + "Send": "RS_Send", + "Receive": "RS_Receive", + "Rewards": "RS_Rewards", + "Search results for %s": "RS_Search results for %s", + "Search": "RS_Search", + "Your email is still not verified.": "RS_Your email is still not verified.", + "Next": "RS_Next", + "Email": "RS_Email", + "Verification Code": "RS_Verification Code", + "A verification code is required to access this version.": "RS_A verification code is required to access this version.", + "Verify": "RS_Verify", + "No code?": "RS_No code?", + "Click here": "RS_Click here", + "Authentication": "RS_Authentication", + "LBRY Early Access": "RS_LBRY Early Access", + "Preparing for first access": "RS_Preparing for first access", + "Welcome to LBRY.": "RS_Welcome to LBRY.", + "Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.": "RS_Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.", + "Up top, LBRY is similar to popular media sites.": "RS_Up top, LBRY is similar to popular media sites.", + "Below, LBRY is controlled by users -- you -- via blockchain and decentralization.": "RS_Below, LBRY is controlled by users -- you -- via blockchain and decentralization.", + "Thank you for making content freedom possible! Here's a nickel, kid.": "RS_Thank you for making content freedom possible! Here's a nickel, kid.", + "Developer Settings": "RS_Developer Settings", + "Show developer menu": "RS_Show developer menu", + "Use custom search servers": "RS_Use custom search servers", + "Custom search servers (one per line)": "RS_Custom search servers (one per line)", + "Force Upgrade": "RS_Force Upgrade", + "OK": "RS_OK", + "Show More...": "RS_Show More...", + "Show Less": "RS_Show Less", + "Starting daemon": "RS_Starting daemon", + "Waiting for name resolution": "RS_Waiting for name resolution", + "Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.": "RS_Using LBRY is like dating a centaur. Totally normal up top, and way different underneath.", + "Claim Reward": "RS_Claim Reward", + "Claiming...": "RS_Claiming...", + "This is an estimate and does not include data fees": "RS_This is an estimate and does not include data fees", + "free": "RS_free", + "Reward Claim Error": "RS_Reward Claim Error", + "This field is required": "RS_This field is required", + "Choose File": "RS_Choose File", + "No File Chosen": "RS_No File Chosen", + "Choose Directory": "RS_Choose Directory", + "Downloading Update": "RS_Downloading Update", + "Click \"Begin Upgrade\" to start the upgrade process.": "RS_Click \"Begin Upgrade\" to start the upgrade process.", + "The app will close, and you will be prompted to install the latest version of LBRY.": "RS_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.": "RS_After the install is complete, please reopen the app.", + "Begin Upgrade": "RS_Begin Upgrade", + "API connection string": "RS_API connection string", + "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.": "RS_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": "RS_You haven't downloaded anything from LBRY yet. Go", + "search for your first download": "RS_search for your first download", + "Loading": "RS_Loading", + " credits": "RS_ credits", + "It looks like you haven't published anything to LBRY yet. Go": "RS_It looks like you haven't published anything to LBRY yet. Go", + "share your beautiful cats with the world": "RS_share your beautiful cats with the world", + "report": "RS_report", + "Content-Type": "RS_Content-Type", + "Author": "RS_Author", + "License": "RS_License", + "Read the FAQ": "RS_Read the FAQ", + "Our FAQ answers many common questions.": "RS_Our FAQ answers many common questions.", + "Get Live Help": "RS_Get Live Help", + "Live help is available most hours in the": "RS_Live help is available most hours in the", + "channel of our Slack chat room.": "RS_channel of our Slack chat room.", + "Join Our Slack": "RS_Join Our Slack", + "Report a Bug": "RS_Report a Bug", + "Did you find something wrong?": "RS_Did you find something wrong?", + "Submit a Bug Report": "RS_Submit a Bug Report", + "Thanks! LBRY is made by its users.": "RS_Thanks! LBRY is made by its users.", + "Report": "RS_Report", + "About": "RS_About", + "A newer version of LBRY is available.": "RS_A newer version of LBRY is available.", + "Download LBRY %s now!": "RS_Download LBRY %s now!", + "Your copy of LBRY is up to date.": "RS_Your copy of LBRY is up to date.", + "daemon (lbrynet)": "RS_daemon (lbrynet)", + "wallet (lbryum)": "RS_wallet (lbryum)", + "interface": "RS_interface", + "Platform": "RS_Platform", + "Installation ID": "RS_Installation ID", + "Search Results for": "RS_Search Results for", + "These search results are provided by LBRY, Inc.": "RS_These search results are provided by LBRY, Inc.", + "Exact URL": "RS_Exact URL", + "This is the resolution of a LBRY URL and not controlled by LBRY Inc.": "RS_This is the resolution of a LBRY URL and not controlled by LBRY Inc.", + "Download Directory": "RS_Download Directory", + "LBRY downloads will be saved here.": "RS_LBRY downloads will be saved here.", + "Bandwidth Limits": "RS_Bandwidth Limits", + "Max Upload": "RS_Max Upload", + "Unlimited": "RS_Unlimited", + "Up to": "RS_Up to", + "Max Download": "RS_Max Download", + "Show unavailable content in search results": "RS_Show unavailable content in search results", + "Show NSFW content": "RS_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. ": "RS_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": "RS_Share Diagnostic Data", + "Help make LBRY better by contributing diagnostic data about my usage": "RS_Help make LBRY better by contributing diagnostic data about my usage", + "Choose limit...": "RS_Choose limit...", + "Loading magic decentralized data...": "RS_Loading magic decentralized data...", + "There's nothing at this location.": "RS_There's nothing at this location.", + "Report an Issue": "RS_Report an Issue", + "Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!": "RS_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": "RS_Description of your issue", + "Submit Report": "RS_Submit Report", + "Developer?": "RS_Developer?", + "You can also": "RS_You can also", + "submit an issue on GitHub": "RS_submit an issue on GitHub", + "Bug report submitted": "RS_Bug report submitted", + "Your bug report has been submitted! Thank you for your feedback.": "RS_Your bug report has been submitted! Thank you for your feedback.", + "Balance": "RS_Balance", + "Open in Folder": "RS_Open in Folder", + "Checking availability": "RS_Checking availability", + "Confirm Purchase": "RS_Confirm Purchase", + "This will purchase": "RS_This will purchase", + "for": "RS_for", + "credits": "RS_credits", + "Not enough credits": "RS_Not enough credits", + "You don't have enough LBRY credits to pay for this stream.": "RS_You don't have enough LBRY credits to pay for this stream.", + "Download failed": "RS_Download failed", + "LBRY was unable to download the stream": "RS_LBRY was unable to download the stream", + "Remove": "RS_Remove", + "Are you sure you'd like to remove": "RS_Are you sure you'd like to remove", + "from LBRY?": "RS_from LBRY?", + "Delete this file from my computer": "RS_Delete this file from my computer", + "Download": "RS_Download", + "Content unavailable.": "RS_Content unavailable.", + "Why?": "RS_Why?", + "The content on LBRY is hosted by its users. It appears there are no users connected that have this file at the moment.": "RS_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": "RS_Try Anyway", + "Open": "RS_Open", + "Remove...": "RS_Remove...", + "% complete": "RS_% complete", + "Loading...": "RS_Loading...", + "Empty claim or metadata info.": "RS_Empty claim or metadata info.", + "This content is Not Safe For Work. To view adult content, please change your": "RS_This content is Not Safe For Work. To view adult content, please change your", + "This address contains no content.": "RS_This address contains no content.", + "Sort by": "RS_Sort by", + "Date": "RS_Date", + "File name": "RS_File name", + "Looking up the Dewey Decimals": "RS_Looking up the Dewey Decimals", + "No one has checked anything in for %s yet.": "RS_No one has checked anything in for %s yet.", + "Be the first": "RS_Be the first", + "Refreshing the Dewey Decimals": "RS_Refreshing the Dewey Decimals", + "This location is unused.": "RS_This location is unused.", + "Put something here!": "RS_Put something here!", + "Transaction History": "RS_Transaction History", + "You have no transactions.": "RS_You have no transactions.", + "Loading transactions": "RS_Loading transactions", + "Amount": "RS_Amount", + "Time": "RS_Time", + "Transaction": "RS_Transaction", + "You earned %s for registering as a new developer.": "RS_You earned %s for registering as a new developer.", + "You earned %s LBC new user reward.": "RS_You earned %s LBC new user reward.", + "You earned %s LBC for verifying your email address.": "RS_You earned %s LBC for verifying your email address.", + "You earned %s LBC for creating a publisher identity.": "RS_You earned %s LBC for creating a publisher identity.", + "You earned %s LBC for streaming your first video.": "RS_You earned %s LBC for streaming your first video.", + "You earned %s LBC for downloading some of the things.": "RS_You earned %s LBC for downloading some of the things.", + "You earned %s LBC for making your first publication.": "RS_You earned %s LBC for making your first publication.", + "Your First Nickel": "RS_Your First Nickel", + "First Publish": "RS_First Publish", + "We're Going Streaming": "RS_We're Going Streaming", + "Channel Surfing": "RS_Channel Surfing", + "Many Views": "RS_Many Views", + "Hot Right Now": "RS_Hot Right Now", + "A welcome bonus for being at the vanguard of content freedom.": "RS_A welcome bonus for being at the vanguard of content freedom.", + "The first view is on us.": "RS_The first view is on us.", + "Up the quad, and to the gymanasium. Press play. Everybody's doing it.": "RS_Up the quad, and to the gymanasium. Press play. Everybody's doing it.", + "Claim your channel! Create an identity used to securely publish content.": "RS_Claim your channel! Create an identity used to securely publish content.", + "Watch a bunch of stuff... who knows how much?": "RS_Watch a bunch of stuff... who knows how much?", + "Watch the latest featured content.": "RS_Watch the latest featured content.", + "Rewards are not enabled.": "RS_Rewards are not enabled.", + "Failed to load rewards.": "RS_Failed to load rewards.", + "Reward claimed.": "RS_Reward claimed.", + "Show All": "RS_Show All", + "Please create a channel identity first.": "RS_Please create a channel identity first.", + "Please publish something and wait for confirmation by the network to claim this reward.": "RS_Please publish something and wait for confirmation by the network to claim this reward.", + "Please publish something to claim this reward.": "RS_Please publish something to claim this reward.", + "Could not connect to Lighthouse server. Last server attempted: %s": "RS_Could not connect to Lighthouse server. Last server attempted: %s", + "LBRY URIs must include a protocol prefix (lbry://).": "RS_LBRY URIs must include a protocol prefix (lbry://).", + "URI does not include name.": "RS_URI does not include name.", + "No channel name after @.": "RS_No channel name after @.", + "Channel names must be at least %s characters.": "RS_Channel names must be at least %s characters.", + "Invalid character %s in name: %s.": "RS_Invalid character %s in name: %s.", + "No modifier provided after separator %s.": "RS_No modifier provided after separator %s.", + "Invalid claim ID %s.": "RS_Invalid claim ID %s.", + "Claim sequence must be a number.": "RS_Claim sequence must be a number.", + "Bid position must be a number.": "RS_Bid position must be a number.", + "Only channel URIs may have a path.": "RS_Only channel URIs may have a path.", + "Invalid character %s in path: %s": "RS_Invalid character %s in path: %s", + "No path provided after /": "RS_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.": "RS_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.": "RS_Path and contentName do not match. Only one is required; most likely you wanted contentName.", + "Internal API disabled": "RS_Internal API disabled", + "LBRY internal API is disabled": "RS_LBRY internal API is disabled", + "Something went wrong making an internal API call.": "RS_Something went wrong making an internal API call.", + "XMLHttpRequest connection timed out": "RS_XMLHttpRequest connection timed out", + "Invalid method": "RS_Invalid method", + "Received invalid authentication response.": "RS_Received invalid authentication response.", + "Unable to connect to LBRY": "RS_Unable to connect to LBRY", + "Resolve has hacked cache on top of it that requires a URI": "RS_Resolve has hacked cache on top of it that requires a URI", + "Connection to API server failed": "RS_Connection to API server failed", + "Please select a file to upgrade from": "RS_Please select a file to upgrade from", + "Update available": "RS_Update available", + "Upgrade": "RS_Upgrade", + "Skip": "RS_Skip", + "Your version of LBRY is out of date and may be unreliable or insecure.": "RS_Your version of LBRY is out of date and may be unreliable or insecure.", + "Sorry, your download timed out :(": "RS_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": "RS_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!": "RS_Downloading stream... not long left now!", + "this is the world's worst loading screen and we shipped our software with it anyway...": "RS_this is the world's worst loading screen and we shipped our software with it anyway...", + "Wallet Address": "RS_Wallet Address", + "Get New Address": "RS_Get New Address", + "Other LBRY users may send credits to you by entering this address on the \"Send\" page.": "RS_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.": "RS_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": "RS_Send Credits", + "Recipient Address": "RS_Recipient Address", + "Insufficient balance": "RS_Insufficient balance", + "Insufficient balance: after this transaction you would have less than 1 LBC in your wallet.": "RS_Insufficient balance: after this transaction you would have less than 1 LBC in your wallet.", + "Transaction successful": "RS_Transaction successful", + "Your transaction was successfully placed in the queue.": "RS_Your transaction was successfully placed in the queue.", + "Transaction failed": "RS_Transaction failed", + "Something went wrong": "RS_Something went wrong", + "Find movies, music, games, and more": "RS_Find movies, music, games, and more", + "Wallet": "RS_Wallet", + "Looking up version info": "RS_Looking up version info" +} diff --git a/ui/js/app.js b/ui/js/app.js index b354036ba..3752f43e5 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -1,4 +1,5 @@ import store from 'store.js'; +import lbry from './lbry.js'; const env = ENV; const config = require(`./config/${env}`); @@ -14,5 +15,11 @@ const app = { } } +const language = lbry.getClientSetting('language') ? lbry.getClientSetting('language') : 'en'; +const i18n = require('y18n')({directory: 'app/locales', locale: language}); +window.__ = i18n.__; +window.__n = i18n.__n; +window.i18n = i18n; + global.app = app; -module.exports = app; \ No newline at end of file +module.exports = app; diff --git a/ui/js/component/auth.js b/ui/js/component/auth.js index b36ff1902..8bea57b38 100644 --- a/ui/js/component/auth.js +++ b/ui/js/component/auth.js @@ -41,7 +41,7 @@ class SubmitEmailStage extends React.Component { lbryio.call('user_email', 'new', {email: this.state.email}, 'post').then(() => { this.onEmailSaved(this.state.email); }, (error) => { - if (error.xhr && (error.xhr.status == 409 || error.message == "This email is already in use")) { + if (error.xhr && (error.xhr.status == 409 || error.message == __("This email is already in use"))) { this.onEmailSaved(this.state.email); return; } else if (this._emailRow) { @@ -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..cc5578f1a 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 dc76fdd4b..053668437 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/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 8b3d2678b..0d45514f7 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -68,7 +68,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; @@ -78,7 +78,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 =
@@ -88,27 +88,27 @@ 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) { if (!costInfo) { - content = + content = } else { - 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?'); } @@ -119,29 +119,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={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} 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} 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} 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/header/index.js b/ui/js/component/header/index.js index dafdabf32..25846b5c3 100644 --- a/ui/js/component/header/index.js +++ b/ui/js/component/header/index.js @@ -13,7 +13,8 @@ import { import Header from './view' const select = (state) => ({ - balance: lbry.formatCredits(selectBalance(state), 1) + balance: lbry.formatCredits(selectBalance(state), 1), + publish: __("Publish"), }) const perform = (dispatch) => ({ diff --git a/ui/js/component/header/view.jsx b/ui/js/component/header/view.jsx index 68328feb9..719cfd2d7 100644 --- a/ui/js/component/header/view.jsx +++ b/ui/js/component/header/view.jsx @@ -6,7 +6,8 @@ export const Header = (props) => { const { balance, back, - navigate + navigate, + publish, } = props return
- +
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/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 98b09db93..8da6d5c0e 100644 --- a/ui/js/component/splash.js +++ b/ui/js/component/splash.js @@ -12,8 +12,8 @@ export class SplashScreen extends React.Component { super(props); this.state = { - details: 'Starting daemon', - message: "Connecting", + details: __('Starting daemon'), + message: __("Connecting"), isLagging: false, }; } @@ -30,8 +30,8 @@ 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({ - message: "Testing Network", - details: "Waiting for name resolution", + message: __("Testing Network"), + details: __("Waiting for name resolution"), isLagging: false }); @@ -55,8 +55,8 @@ export class SplashScreen extends React.Component { .catch(() => { this.setState({ isLagging: true, - message: "Connection Failure", - details: "Try closing all LBRY processes and starting again. If this still happpens, your anti-virus software or firewall may be preventing LBRY from connecting. Contact hello@lbry.io if you think this is a software bug." + message: __("Connection Failure"), + details: __("Try closing all LBRY processes and starting again. If this still happpens, your anti-virus software or firewall may be preventing LBRY from connecting. Contact hello@lbry.io if you think this is a software bug.") }) }) } 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( { (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)} @@ -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 ? - - - - + + + + @@ -62,4 +62,4 @@ class TransactionList extends React.Component{ } } -export default TransactionList \ No newline at end of file +export default TransactionList 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 09ca9a5ac..9881784e7 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -58,20 +58,20 @@ class VideoPlayButton extends React.Component { className="video__play-button" icon={icon} onClick={this.onWatchClick.bind(this)} /> - - You don't have enough LBRY credits to pay for this stream. + + {__("You don't have enough LBRY credits to pay for this stream.")} - This will purchase {title} for credits. + {__("This will purchase")} {title} {__("for")} {__("credits")}. - Sorry, your download timed out :( + isOpen={modal == 'timedOut'} onConfirmed={closeModal} contentLabel={__("Timed Out")}> + {__("Sorry, your download timed out :(")} ); } @@ -107,11 +107,11 @@ class Video extends React.Component { let loadStatusMessage = '' if(fileInfo && fileInfo.completed && !fileInfo.written_bytes) { - loadStatusMessage = "It looks like you deleted or moved this file. We're rebuilding it now. It will only take a few seconds." + loadStatusMessage = __("It looks like you deleted or moved this file. We're rebuilding it now. It will only take a few seconds.") } else 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!") } let klassName = "" @@ -128,8 +128,8 @@ class Video extends React.Component {
{ isPlaying ? (!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/component/wunderbar/view.jsx b/ui/js/component/wunderbar/view.jsx index 45c39b74e..ea361d320 100644 --- a/ui/js/component/wunderbar/view.jsx +++ b/ui/js/component/wunderbar/view.jsx @@ -151,7 +151,7 @@ class WunderBar extends React.PureComponent { onChange={this.onChange} onKeyPress={this.onKeyPress} value={this.state.address} - placeholder="Find movies, music, games, and more" /> + placeholder={__("Find movies, music, games, and more")} />
); } 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 7b95016ac..08565a878 100644 --- a/ui/js/lbry.js +++ b/ui/js/lbry.js @@ -18,6 +18,7 @@ let lbry = { useCustomLighthouseServers: false, customLighthouseServers: [], showDeveloperMenu: false, + language: 'en', } }; @@ -416,7 +417,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 286a70927..6d5a40723 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"))); } }); }; @@ -139,7 +139,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/main.js b/ui/js/main.js index 980bfe17c..a95ac5c96 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -4,11 +4,11 @@ import lbry from './lbry.js'; import lbryio from './lbryio.js'; 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 store from 'store.js'; +import SplashScreen from 'component/splash.js'; +import {AuthOverlay} from 'component/auth.js'; import { doChangePath, doNavigate, @@ -28,6 +28,7 @@ const {remote, ipcRenderer, shell} = require('electron'); const contextMenu = remote.require('./menu/context-menu'); const app = require('./app') + lbry.showMenuIfNeeded(); window.addEventListener('contextmenu', (event) => { 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..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); @@ -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 1842b9156..081465292 100644 --- a/ui/js/page/discover/view.jsx +++ b/ui/js/page/discover/view.jsx @@ -17,7 +17,7 @@ const FeaturedCategory = (props) => { return

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

{names && names.map(name => )}
@@ -42,7 +42,7 @@ class DiscoverPage extends React.Component{
{ fetchingFeaturedUris && - + } { typeof featuredUris === "object" && @@ -52,11 +52,11 @@ class DiscoverPage extends React.Component{ } { failedToLoad && -
Failed to load landing content.
+
{__("Failed to load landing content.")}
}
) } } -export default DiscoverPage; \ No newline at end of file +export default DiscoverPage; 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 b1e031df7..c0c7c1248 100644 --- a/ui/js/page/filePage/view.jsx +++ b/ui/js/page/filePage/view.jsx @@ -26,16 +26,16 @@ const FormatItem = (props) => {
AmountDateTimeTransaction{__("Amount")}{__("Date")}{__("Time")}{__("Transaction")}
- + - + - + - +
Content-Type{mediaType}{__("Content-Type")}{mediaType}
Author{author}{__("Author")}{author}
Language{language}{__("Language")}{language}
License{license}{__("License")}{license}
@@ -75,7 +75,7 @@ class FilePage extends React.Component{ } = this.props if (!claim || !metadata) { - return Empty claim or metadata info. + return {__("Empty claim or metadata info.")} } const { @@ -125,7 +125,7 @@ class FilePage extends React.Component{
: '' }
- +
@@ -133,4 +133,4 @@ class FilePage extends React.Component{ } } -export default FilePage; \ No newline at end of file +export default FilePage; diff --git a/ui/js/page/help/view.jsx b/ui/js/page/help/view.jsx index 2303446d3..8cca6fc5b 100644 --- a/ui/js/page/help/view.jsx +++ b/ui/js/page/help/view.jsx @@ -66,70 +66,71 @@ 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.")}
-

About

-
+

{__("About")}

+
{ this.state.upgradeAvailable === null ? '' : ( this.state.upgradeAvailable ? -

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

)} { this.state.uiVersion && ver ? - + - + - + - + - +
daemon (lbrynet){__("daemon (lbrynet)")} {ver.lbrynet_version}
wallet (lbryum){__("wallet (lbryum)")} {ver.lbryum_version}
interface{__("interface")} {this.state.uiVersion}
Platform{__("Platform")} {platform}
Installation ID{__("Installation ID")} {this.state.lbryId}
: - + }
+ } ); } diff --git a/ui/js/page/publish/view.jsx b/ui/js/page/publish/view.jsx index 6edb9e371..0e33a4ea6 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}
); 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/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/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}

diff --git a/ui/js/page/settings/view.jsx b/ui/js/page/settings/view.jsx index d1a4f188c..973f4d75a 100644 --- a/ui/js/page/settings/view.jsx +++ b/ui/js/page/settings/view.jsx @@ -3,10 +3,11 @@ import {FormField, FormRow} from 'component/form.js'; import SubHeader from 'component/subHeader' import lbry from 'lbry.js'; + class SettingsPage extends React.Component { constructor(props) { super(props); - + const daemonSettings = this.props.daemonSettings this.state = { @@ -14,6 +15,7 @@ class SettingsPage extends React.Component { isMaxDownload: daemonSettings && daemonSettings.max_download != 0, showNsfw: lbry.getClientSetting('showNsfw'), showUnavailable: lbry.getClientSetting('showUnavailable'), + language: lbry.getClientSetting('language'), } } @@ -68,6 +70,12 @@ class SettingsPage extends React.Component { lbry.setClientSetting('showNsfw', event.target.checked); } + onLanguageChange(language) { + lbry.setClientSetting('language', language); + i18n.setLocale(language); + this.setState({language: language}) + } + onShowUnavailableChange(event) { } @@ -78,7 +86,7 @@ class SettingsPage extends React.Component { } = this.props if (!daemonSettings) { - return
Failed to load settings.
; + return
{__("Failed to load settings.")}
; } /*
@@ -98,33 +106,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 +160,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

+

{__("Language")}

+
+
+
+ { this.onLanguageChange('en') }} + defaultChecked={this.state.language=='en'} /> +
+
+ { this.onLanguageChange('rs') }} + defaultChecked={this.state.language=='rs'} /> +
+
+
+ +
+
+

{__("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/start.js b/ui/js/page/start.js index 9a2b388b1..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/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")}

diff --git a/ui/js/rewards.js b/ui/js/rewards.js index a3ac1e958..f7998ce06 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]; } @@ -82,7 +82,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}) => { @@ -97,7 +97,7 @@ rewards.claimReward = function (type) { // Display global notice const action = doShowSnackBar({ message, - linkText: "Show All", + linkText: __("Show All"), linkTarget: "/rewards", isError: false, }) @@ -126,7 +126,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; @@ -141,8 +141,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; diff --git a/ui/js/selectors/app.js b/ui/js/selectors/app.js index 778ac8a87..287739a9b 100644 --- a/ui/js/selectors/app.js +++ b/ui/js/selectors/app.js @@ -38,35 +38,28 @@ export const selectPageTitle = createSelector( selectCurrentParams, (page, params) => { switch (page) { - case 'search': - return params.query ? `Search results for ${params.query}` : 'Search' case 'settings': - return 'Settings' case 'help': - return 'Help' case 'report': - return 'Report' case 'wallet': case 'send': case 'receive': case 'rewards': - return page.charAt(0).toUpperCase() + page.slice(1) + case 'start': + case 'publish': + case 'help': + case 'developer': + return __(page.charAt(0).toUpperCase() + page.slice(1)) + case 'search': + return params.query ? __("Search results for %s", params.query) : __('Search') case 'show': return lbryuri.normalize(params.uri) case 'downloaded': - return 'Downloads & Purchases' + return __('Downloads & Purchases') case 'published': - return 'Publishes' - case 'start': - return 'Start' - case 'publish': - return 'Publish' - case 'help': - return 'Help' - case 'developer': - return 'Developer' + return __('Publishes') case 'discover': - return 'Home' + return __('Home') default: return ''; } @@ -142,22 +135,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 +196,4 @@ export const selectSnackBar = createSelector( export const selectSnackBarSnacks = createSelector( selectSnackBar, (snackBar) => snackBar.snacks || [] -) \ No newline at end of file +)