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

UILD-404: Enable translation compilation #17

Merged
merged 1 commit into from
Oct 31, 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
2 changes: 1 addition & 1 deletion .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.ref_name == github.event.repository.default_branch || github.event_name != 'push' || github.ref_type == 'tag'
secrets: inherit
with:
compile-translations: false
compile-translations: true
jest-test-command: npm run test:unit
sonar-enabled: false
install-before-publish: true
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build": "tsc && vite build",
"build:lib": "npm run build --type=library",
"prepare": "npm run build:lib",
"formatjs-compile": "formatjs compile-folder --ast --format simple ./translations/ui-linked-data ./translations/ui-linked-data/compiled",
"lint:errors-only": "eslint src --ext ts,tsx --report-unused-disable-directives --quiet",
"lint:full": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
Expand Down
5 changes: 3 additions & 2 deletions src/components/ViewMarcControlPane/ViewMarcControlPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export const ViewMarcControlPane = () => {
values={{
title: (
<span data-testid="marc-title">
{(record?.resource && getRecordTitle(record.resource as RecordEntry)) ??
formatMessage({ id: 'ld.noTitleInBrackets' })}
{(record?.resource && getRecordTitle(record.resource as RecordEntry)) ?? (
<>&lt;{formatMessage({ id: 'ld.noTitleInBrackets' })}&gt;</>
)}
</span>
),
}}
Expand Down
8 changes: 7 additions & 1 deletion src/components/WorkDetailsCard/WorkDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export const WorkDetailsCard: FC<WorkDetailsCard> = ({
className="title"
data-testid={`preview-button__${id}`}
>
{title || <FormattedMessage id="ld.noTitleInBrackets" />}
{title || (
<>
&lt;
<FormattedMessage id="ld.noTitleInBrackets" />
&gt;
</>
)}
</Button>
{creatorName && (
<div className="details-item">
Expand Down
2 changes: 1 addition & 1 deletion translations/ui-linked-data/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"ld.unsavedRecentEdits": "Recent edits made to the resource have not been saved. Unsaved changes will be lost.",
"ld.unsavedChanges": "Unsaved changes",
"ld.continueWithoutSaving": "Continue without saving",
"ld.noTitleInBrackets": "<No title>",
"ld.noTitleInBrackets": "No title",
"ld.viewMarc": "View MARC",
"ld.marcWithTitle": "MARC - {title}",
"ld.cantLoadMarc": "Can't load MARC for this resource description",
Expand Down
Loading