Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n catchup #528

Merged
merged 3 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 96 additions & 33 deletions src/langs/json/en.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"common": {
"emailAddress": "Email address",
"loading": "Loading...",
"loading": "Loading",
"documentCloud": "DocumentCloud",
"home": "Home",
"new": "New",
"learnMore": "Learn more"
"learnMore": "Learn more",
"or": "or",
"explore": "Explore"
},
"homeTemplate": {
"signedIn": "Signed in as {name}",
Expand All @@ -14,6 +16,30 @@
"signUp": "Sign up",
"goToApp": "Go to app"
},
"inputs": {
"required": "Required",
"selectAll": "Select all",
"selected": "selected",
"resultsCount": "Showing {n, number} of {total, number} results"
},
"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"
Expand Down Expand Up @@ -349,6 +375,47 @@
"specialMessage": {
"contactUs": "<a href={contact} target=\"_blank\">Contact us</a> with bug reports, questions, and suggestions."
},
"uploadDialog": {
"title": "Upload documents",
"description": "Select or drag a document to begin the document upload process. You will then be able to edit document information.",
"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": "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://tesseract-ocr.github.io/tessdoc/\">Tesseract</a> is an open source OCR engine available free to all DocumentCloud accounts.",
"textract": "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://aws.amazon.com/textract/\">Textract</a> 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:",
Expand All @@ -360,7 +427,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",
Expand Down Expand Up @@ -440,6 +508,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"
Expand Down Expand Up @@ -575,39 +644,21 @@
"orgDocuments": "{name}’s Documents",
"newProject": "New Project",
"createProject": "Create your first project by clicking “New Project” above.",
"pinsEmpty": "Pinned projects will appear here for quick access"
"pinsEmpty": "Pinned projects will appear here for quick access",
"private": "Private Project",
"public": "Public Project",
"loading": "Loading project documents…",
"empty": "This project is empty",
"error": "Error loading project documents",
"viewInSearch": "View in Document Search",
"yours": "Your Projects",
"shared": "Shared with you",
"none": "No projects found",
"create": "Create project"
},
"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 <span class=\"DC-note-logotype-link\">DocumentCloud</span>"
Expand Down Expand Up @@ -748,6 +799,7 @@
"source": "Source: {source}",
"actions": "Document Actions",
"share": "Share",
"shareEmbed": "Share & Embed",
"shareDesc": "Create an embed or share on social media.",
"annotate": "Add Note",
"annotateDesc": "Leave a public, private or shared note, which can be embedded within an article.",
Expand All @@ -764,7 +816,18 @@
"privateNote": "Add Private Note",
"privateNoteDesc": "Leave a public, private or shared note, which can be embedded within an article.",
"revisions": "Revision History",
"revisionsDesc": "Toggle revision history and view previous versions of your document."
"revisionsDesc": "Toggle revision history and view previous versions of your document.",
"collaborate": "Manage Collaborators",
"edit": "Edit",
"upload": "Upload Documents",
"addons": {
"title": "Add-Ons",
"pinned": "Pinned add-ons will appear here"
},
"projects": {
"title": "Projects",
"pinned": "Pinned projects will appear here"
}
},
"viewer": {
"notFound": "Document not found",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/common/FieldLabel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-->

<script lang="ts">
import { _ } from "svelte-i18n";
import PremiumBadge from "@/premium-credits/PremiumBadge.svelte";
import Flex from "./Flex.svelte";

Expand All @@ -19,7 +20,7 @@
{/if}
<slot />
{#if required}
<span class="required">Required</span>
<span class="required">{$_("inputs.required")}</span>
{/if}
</Flex>
{#if premium}<PremiumBadge />{/if}
Expand Down
5 changes: 5 additions & 0 deletions src/lib/components/common/Premium.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
@component
Render the default slot if the user has a premium account (individual or organization).
The "basic" slot is available as a fallback.
-->
<script lang="ts">
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
Expand Down
5 changes: 5 additions & 0 deletions src/lib/components/common/SignedIn.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
@component
Render the default slot if the user is signed in.
The "signedOut" slot is available as a fallback.
-->
<script lang="ts">
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
Expand Down
6 changes: 6 additions & 0 deletions src/lib/components/documents/DocumentListItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
function clean(html: string) {
return DOMPurify.sanitize(html, { ALLOWED_TAGS: [] });
}

function onError() {
document.status = "error";
}
</script>

<!--
Expand All @@ -53,6 +57,8 @@ It's deliberately minimal and can be wrapped in other components to add addition
alt="Page 1, {document.title}"
width="{width}px"
height="{height}px"
loading="lazy"
on:error={onError}
/>
{:else}
<div class="fallback {document.status}">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/documents/ResultsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<Flex direction="column">
<Flex gap={0.625} align="center">
<label>
<span class="sr-only">Select</span>
<span class="sr-only">{$_("documents.select")}</span>
<input
type="checkbox"
bind:group={$selected}
Expand Down
37 changes: 18 additions & 19 deletions src/lib/components/forms/DocumentUpload.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@
{
value: "tess4",
label: "Tesseract",
help: $_("uploadOptions.tesseract"),
help: $_("uploadDialog.tesseract"),
},
{
value: "textract",
label: "Textract",
help: $_("uploadOptions.textract"),
help: $_("uploadDialog.textract"),
},
];

Expand Down Expand Up @@ -262,14 +262,13 @@
</Flex>
{:else}
<Empty icon={File24}>
Get started by selecting, pasting or dragging-and-dropping files
below
{$_("uploadDialog.empty")}
</Empty>
{/each}
{#if files.length > 0}
<div class="total">
<p>
Total: {files.length} file{files.length > 1 ? "s" : ""},
{$_("uploadDialog.totalFiles", { values: { n: files.length } })},
<span class="uppercase">{filesize(total)}</span>
</p>
</div>
Expand All @@ -286,11 +285,11 @@
class:active={fileDropActive}
class:disabled={loading}
>
<p class="drop-instructions">Drag and drop files here</p>
<p class="drop-instructions">{$_("uploadDialog.dragDrop")}</p>
<Flex align="center" justify="center">
<span class="drop-instructions-or">or</span>
<span class="drop-instructions-or">{$_("common.or")}</span>
<FileInput multiple onFileSelect={addFiles} disabled={loading}
><File16 /> Select Files</FileInput
><File16 />{$_("uploadDialog.selectFiles")}</FileInput
>
</Flex>
</div>
Expand All @@ -300,11 +299,11 @@
<div class="sidebar">
<Flex gap={1} direction="column">
<Field>
<FieldLabel>Access Level</FieldLabel>
<FieldLabel>{$_("uploadDialog.accessLevel")}</FieldLabel>
<AccessLevel name="access" />
</Field>
<Field>
<FieldLabel>Projects</FieldLabel>
<FieldLabel>{$_("uploadDialog.projects")}</FieldLabel>
<Select
name="projects"
multiple
Expand All @@ -315,11 +314,11 @@
</Field>
<hr class="divider" />
<Field>
<FieldLabel>Language</FieldLabel>
<FieldLabel>{$_("uploadDialog.language")}</FieldLabel>
<Language />
</Field>
<Field>
<FieldLabel>OCR Engine</FieldLabel>
<FieldLabel>{$_("uploadDialog.ocrEngine")}</FieldLabel>
<Select
name="ocr_engine"
items={ocrEngineOptions}
Expand All @@ -331,25 +330,24 @@
</Field>
<Field inline>
<input type="checkbox" name="force_ocr" />
<FieldLabel>Force OCR</FieldLabel>
<FieldLabel>{$_("uploadDialog.forceOcr")}</FieldLabel>
</Field>
<hr class="divider" />

<Premium>
<Field inline>
<Switch name="revision_control" />
<FieldLabel premium>Revision Control</FieldLabel>
<FieldLabel premium>{$_("uploadDialog.revisionControl")}</FieldLabel
>
<p slot="help">
All previous versions to the document will be preserved and
available for download.
{$_("uploadDialog.revisionControlHelp")}
</p>
</Field>
<Field inline slot="basic">
<Switch name="revision_control" disabled />
<FieldLabel premium>Revision Control</FieldLabel>
<p slot="help">
All previous versions to the document will be preserved and
available for download.
{$_("uploadDialog.revisionControlHelp")}
</p>
</Field>
</Premium>
Expand All @@ -358,7 +356,8 @@
type="submit"
full
mode="primary"
disabled={loading || exceedsSizeLimit}><Upload16 />Begin Upload</Button
disabled={loading || exceedsSizeLimit}
><Upload16 />{$_("uploadDialog.beginUpload")}</Button
>

<input
Expand Down
Loading
Loading