From 41d9c72045b7f3e096b7d15a2e30e4ae4f7c11c6 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Wed, 24 Apr 2024 16:07:26 -0400 Subject: [PATCH 1/2] i18n for lib/components --- package-lock.json | 6 +- src/langs/json/en.json | 95 +++++++++++++------ src/lib/components/common/FieldLabel.svelte | 3 +- src/lib/components/common/Premium.svelte | 5 + src/lib/components/common/SignedIn.svelte | 5 + .../documents/DocumentListItem.svelte | 6 ++ .../components/documents/ResultsList.svelte | 2 +- .../components/forms/DocumentUpload.svelte | 37 ++++---- src/lib/components/inputs/AccessLevel.svelte | 20 ++-- src/lib/components/inputs/Search.svelte | 3 +- src/lib/components/layouts/MainLayout.svelte | 6 +- src/lib/components/navigation/UserMenu.svelte | 1 - 12 files changed, 122 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4112cb48f..967288491 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20240,9 +20240,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", diff --git a/src/langs/json/en.json b/src/langs/json/en.json index 376ea20ed..7442ccef0 100644 --- a/src/langs/json/en.json +++ b/src/langs/json/en.json @@ -5,7 +5,8 @@ "documentCloud": "DocumentCloud", "home": "Home", "new": "New", - "learnMore": "Learn more" + "learnMore": "Learn more", + "or": "or" }, "homeTemplate": { "signedIn": "Signed in as {name}", @@ -14,6 +15,27 @@ "signUp": "Sign up", "goToApp": "Go to app" }, + "inputs": { + "required": "Required" + }, + "access": { + "access": "Access", + "private": { + "value": "private", + "title": "Private", + "description": "Documents will only be visible to you" + }, + "organization": { + "value": "organization", + "title": "Organization", + "description": "Documents will only be visible to your organization" + }, + "public": { + "value": "public", + "title": "Public", + "description": "Documents will be publicly visible to everyone" + } + }, "notfound": { "title": "Page not found", "content": "Please try another URL" @@ -349,6 +371,45 @@ "specialMessage": { "contactUs": "Contact us with bug reports, questions, and suggestions." }, + "uploadDialog": { + "docUpload": "Document Upload", + "docUploadProj": "Document Upload to {title}", + "selectDocument": "Select or drag a document to begin the document upload process. You will then be able to edit document information.", + "pdfSizeWarning": "You can only upload PDF files under {size}.", + "nonPdfSizeWarning": "You can only upload non-PDF document files under {size}.", + "fileReady": "{n, plural, one {file} other {files}} ready to upload", + "fileLimitWarning": "You can only upload {limit} files at once.", + "moreOptions": "More options", + "beginUpload": "Begin Upload", + "selectFiles": "Select files", + "dragDrop": "Drag and drop files here", + "publicMsg": "Document will be publicly visible.", + "collabMsg": "Document will be visible to your organization.", + "privateMsg": "Document will be visible to you alone.", + "collabName": "Organization", + "submitting": "Almost done... submitting uploaded files for processing ({percent})", + "uploading": "Uploading ... ({uploaded}/{length})", + "gettingInfo": "Getting upload information ({percent})", + "pleaseLeaveOpen": "Please leave this page open while your documents upload. This dialog will automatically close when they have finished uploading.", + "errorHeading": "Error occurred while uploading", + "errorMsg": "We failed to {errorMessage}. Please try again later.", + "editDocInfo": "Edit document information:", + "untitled": "Untitled", + "uploadFiles": "Upload additional files", + "selectMore": "+ Select more files", + "dragDropMore": "Drag and drop additional files here", + "totalFiles": "Total: {n, plural, one {# file} other {# files}}", + "accessLevel": "Access Level", + "projects": "Projects", + "language": "Language", + "ocrEngine": "OCR Engine", + "forceOcr": "Force OCR", + "revisionControl": "Revision Control", + "revisionControlHelp": "All previous versions to the document will be preserved and available for download.", + "tesseract": "Tesseract is an open source OCR engine available free to all DocumentCloud accounts.", + "textract": "Textract is a more powerful OCR engine that can better handle messy text, handwriting and fuzzy scans.", + "empty": "Get started by selecting, pasting or dragging-and-dropping files below" + }, "uploadOptions": { "documentLang": "Document language:", "forceOcr": "Force OCR:", @@ -360,7 +421,8 @@ "creditHelpText": "Selecting Textract will cost one AI Credit per page in the document. If you go over, the document will fall back to using Tesseract. You are currently working on behalf of {organization} and have {n, plural, one {# credit} other {# credits}} left.", "documentLanguagePlaceholder": "Begin typing to see options", "revisionControl": "Revision Control:", - "revisionControlHelp": "All previous versions to the document will be preserved and available for download." + "revisionControlHelp": "All previous versions to the document will be preserved and available for download.", + "empty": "Get started by selecting, pasting or dragging-and-dropping files below" }, "actionBar": { "selectDocs": "Select some documents to reveal edit actions", @@ -440,6 +502,7 @@ "page": "Page", "pageAbbrev": "p.", "pageCount": "{n, plural, one {# page} other {# pages}}", + "select": "Select", "source": "Source", "noteCount": "{n, plural, one {# note} other {# notes}}", "noteLink": "See note" @@ -580,34 +643,6 @@ "organizations": { "sameOrgUsers": "Users in organization" }, - "uploadDialog": { - "docUpload": "Document Upload", - "docUploadProj": "Document Upload to {title}", - "selectDocument": "Select or drag a document to begin the document upload process. You will then be able to edit document information.", - "pdfSizeWarning": "You can only upload PDF files under {size}.", - "nonPdfSizeWarning": "You can only upload non-PDF document files under {size}.", - "fileReady": "{n, plural, one {file} other {files}} ready to upload", - "fileLimitWarning": "You can only upload {limit} files at once.", - "moreOptions": "More options", - "beginUpload": "Begin upload", - "selectFiles": "+ Select files", - "dragDrop": "Drag and drop files here", - "publicMsg": "Document will be publicly visible.", - "collabMsg": "Document will be visible to your organization.", - "privateMsg": "Document will be visible to you alone.", - "collabName": "Organization", - "submitting": "Almost done... submitting uploaded files for processing ({percent})", - "uploading": "Uploading ... ({uploaded}/{length})", - "gettingInfo": "Getting upload information ({percent})", - "pleaseLeaveOpen": "Please leave this page open while your documents upload. This dialog will automatically close when they have finished uploading.", - "errorHeading": "Error occurred while uploading", - "errorMsg": "We failed to {errorMessage}. Please try again later.", - "editDocInfo": "Edit document information:", - "untitled": "Untitled", - "uploadFiles": "Upload additional files", - "selectMore": "+ Select more files", - "dragDropMore": "Drag and drop additional files here" - }, "embedNote": { "viewTheNote": "View the note ‘{title}‘ in its original document context on DocumentCloud in a new window or tab", "viewDoc": "View the entire document with DocumentCloud" diff --git a/src/lib/components/common/FieldLabel.svelte b/src/lib/components/common/FieldLabel.svelte index d06ce7b9c..d0584f7cf 100644 --- a/src/lib/components/common/FieldLabel.svelte +++ b/src/lib/components/common/FieldLabel.svelte @@ -4,6 +4,7 @@ -->