Skip to content

Commit

Permalink
update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
SuaYoo committed Jan 22, 2025
1 parent 7fcb84d commit 1218c87
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
7 changes: 4 additions & 3 deletions frontend/src/features/collections/select-collection-access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { customElement, property } from "lit/decorators.js";
import { when } from "lit/directives/when.js";

import { BtrixElement } from "@/classes/BtrixElement";
import { metadata } from "@/strings/collections/metadata";
import { CollectionAccess } from "@/types/collection";

@localized()
Expand Down Expand Up @@ -110,9 +111,9 @@ export class SelectCollectionAccess extends BtrixElement {
<li>${msg("Name")}</li>
<li>${msg("Summary")}</li>
<li>${msg("About")}</li>
<li>${msg("Collection Period")}</li>
<li>${msg("Unique Pages in Collection")}</li>
<li>${msg("Total Pages Crawled")}</li>
<li>${metadata.dateLatest}</li>
<li>${metadata.uniquePageCount}</li>
<li>${metadata.pageCount}</li>
<li>${msg("Collection Size")}</li>
</ul>
</sl-details>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/layouts/collections/metadataColumn.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { msg } from "@lit/localize";
import { html, type TemplateResult } from "lit";
import { when } from "lit/directives/when.js";

import { metadata } from "@/strings/collections/metadata";
import { monthYearDateRange } from "@/strings/utils";
import type { Collection, PublicCollection } from "@/types/collection";
import localize from "@/utils/localize";
Expand Down Expand Up @@ -35,20 +35,20 @@ export function metadataColumn(collection?: Collection | PublicCollection) {
return html`
<btrix-desc-list>
${metadataItem({
label: msg("Collection Period"),
label: metadata.dateLatest,
render: (col) => html`
<span class="font-sans">
${monthYearDateRange(col.dateEarliest, col.dateLatest)}
</span>
`,
})}
${metadataItem({
label: msg("Unique Pages in Collection"),
label: metadata.uniquePageCount,
render: (col) =>
`${localize.number(col.uniquePageCount)} ${pluralOf("pages", col.uniquePageCount)}`,
})}
${metadataItem({
label: msg("Total Pages Crawled"),
label: metadata.pageCount,
render: (col) =>
`${localize.number(col.pageCount)} ${pluralOf("pages", col.pageCount)}`,
})}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/org/collections-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { SelectCollectionAccess } from "@/features/collections/select-collection
import { emptyMessage } from "@/layouts/emptyMessage";
import { pageHeader } from "@/layouts/pageHeader";
import { RouteNamespace } from "@/routes";
import { metadata } from "@/strings/collections/metadata";
import { monthYearDateRange } from "@/strings/utils";
import type { APIPaginatedList, APIPaginationQuery } from "@/types/api";
import {
Expand Down Expand Up @@ -56,7 +57,7 @@ const sortableFields: Record<
defaultDirection: SortDirection.Ascending,
},
dateLatest: {
label: msg("Collection Period"),
label: metadata.dateLatest,
defaultDirection: SortDirection.Descending,
},
crawlCount: {
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/strings/collections/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { msg } from "@lit/localize";

export const metadata = {
dateLatest: msg("Collection Period"),
uniquePageCount: msg("Unique Pages in Collection"),
pageCount: msg("Total Pages Crawled"),
};

0 comments on commit 1218c87

Please sign in to comment.