From f4887008a5a8d94c123c3971d141fbe490091363 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Tue, 23 Oct 2018 11:37:59 -0400 Subject: [PATCH] Extract strings for localizing the preview page --- .../modal/comments/delete-comment.jsx | 2 +- .../modal/comments/report-comment.jsx | 2 +- src/l10n.json | 3 +- src/views/preview/extension-chip.jsx | 2 +- src/views/preview/l10n.json | 11 ++++++- src/views/preview/presentation.jsx | 10 +++---- src/views/preview/remix-credit.jsx | 29 ++++++++++++------- src/views/preview/remix-list.jsx | 5 ++-- src/views/preview/studio-list.jsx | 5 ++-- src/views/preview/subactions.jsx | 7 +++-- 10 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/components/modal/comments/delete-comment.jsx b/src/components/modal/comments/delete-comment.jsx index 0d2264854..5ddccee4a 100644 --- a/src/components/modal/comments/delete-comment.jsx +++ b/src/components/modal/comments/delete-comment.jsx @@ -55,7 +55,7 @@ const DeleteModal = ({ type="button" onClick={onReport} > - + )} diff --git a/src/l10n.json b/src/l10n.json index 917a0a6d5..ba8197c04 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -84,6 +84,8 @@ "general.website": "Website", "general.whatsHappening": "What's Happening?", "general.wiki": "Scratch Wiki", + "general.copyLink": "Copy Link", + "general.report": "Report", "general.all": "All", "general.animations": "Animations", @@ -204,7 +206,6 @@ "report.sending": "Sending...", "report.textMissing": "Please tell us why you are reporting this project", - "comments.report": "Report", "comments.delete": "Delete", "comments.restore": "Restore", "comments.reportModal.title": "Report Comment", diff --git a/src/views/preview/extension-chip.jsx b/src/views/preview/extension-chip.jsx index 5213ab6f1..aecdc2724 100644 --- a/src/views/preview/extension-chip.jsx +++ b/src/views/preview/extension-chip.jsx @@ -19,7 +19,7 @@ const ExtensionChip = props => ( } {props.hasStatus && (
- Needs Connection +
)} diff --git a/src/views/preview/l10n.json b/src/views/preview/l10n.json index 07782dbe3..2cfa687f4 100644 --- a/src/views/preview/l10n.json +++ b/src/views/preview/l10n.json @@ -1,15 +1,24 @@ { "addToStudio.title": "Add to Studio", "addToStudio.finishing": "Finishing up...", + "addToStudio.inviteUser": "Invite user to add to studio", "preview.titleMaxLength": "Title is too long", "preview.musicExtensionChip": "Music", "preview.penExtensionChip": "Pen", "preview.speechExtensionChip": "Google Speech", "preview.translateExtensionChip": "Google Translate", "preview.videoMotionChip": "Video Motion", + "preview.needsConnection": "Needs Connection", "preview.comments.header": "Comments", "preview.comments.turnOff": "Turn off commenting", "preview.comments.turnedOff": "Sorry, comment posting has been turned off for this project.", "preview.share.notShared": "This project is not shared — so only you can see it. Click share to let everyone see it!", - "preview.share.shareButton": "Share" + "preview.share.shareButton": "Share", + "preview.seeInsideButton": "See inside", + "preview.remixButton": "Remix", + "preview.remixes": "Remixes", + "preview.inviteToRemix": "Invite user to remix", + "preview.instructionsLabel": "Instructions", + "preview.notesAndCreditsLabel": "Notes and Credits", + "preview.credit": "Thanks to {userLink} for the original project {projectLink}." } diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index de421d13e..28fe9877c 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -140,14 +140,14 @@ const PreviewPresentation = ({ {/* TODO: Hide Remix button for now until implemented */} {(!userOwnsProject && false) && } @@ -213,7 +213,7 @@ const PreviewPresentation = ({
- Instructions +
{editable ?
- Notes and Credits +
{editable ? - Load More + }
diff --git a/src/views/preview/remix-credit.jsx b/src/views/preview/remix-credit.jsx index a3557d454..b11359f6f 100644 --- a/src/views/preview/remix-credit.jsx +++ b/src/views/preview/remix-credit.jsx @@ -1,4 +1,5 @@ const React = require('react'); +const FormattedMessage = require('react-intl').FormattedMessage; const FlexRow = require('../../components/flex-row/flex-row.jsx'); const Avatar = require('../../components/avatar/avatar.jsx'); const projectShape = require('./projectshape.jsx').projectShape; @@ -13,16 +14,24 @@ const RemixCredit = props => { src={`https://cdn2.scratch.mit.edu/get_image/user/${projectInfo.author.id}_48x48.png`} />
- Thanks to - {projectInfo.author.username} - for the original project - {projectInfo.title} - . + + {projectInfo.author.username} + + ), + projectLink: ( + + {projectInfo.title} + + ) + }} + />
); diff --git a/src/views/preview/remix-list.jsx b/src/views/preview/remix-list.jsx index f9fb4d7c3..684f489f0 100644 --- a/src/views/preview/remix-list.jsx +++ b/src/views/preview/remix-list.jsx @@ -1,5 +1,6 @@ const React = require('react'); const PropTypes = require('prop-types'); +const FormattedMessage = require('react-intl').FormattedMessage; const FlexRow = require('../../components/flex-row/flex-row.jsx'); const ThumbnailColumn = require('../../components/thumbnailcolumn/thumbnailcolumn.jsx'); const projectShape = require('./projectshape.jsx').projectShape; @@ -10,11 +11,11 @@ const RemixList = props => { return (
- Remixes +
{remixes.length === 0 ? ( // TODO: style remix invitation - Invite user to remix + ) : ( { return (
- Studios +
{studios.length === 0 ? ( // TODO: style remix invitation - Invite user to add to studio + ) : ( ( key="add-to-studio-button" onClick={props.onAddToStudioClicked} > - Add to Studio + {props.addToStudioOpen && ( ( } {(props.canReport) && @@ -56,7 +57,7 @@ const Subactions = props => ( key="report-button" onClick={props.onReportClicked} > - Report + {props.reportOpen && (