fix(import): pluralize the panel's count strings

A single-item import rendered "1 conversations", "1 attachment(s)", and
"1 items could not be imported". The counts now use the i18next plural
convention already established by com_ui_tools_count, with the secondary
numbers left bare where they read correctly either way.
This commit is contained in:
Marco Beretta 2026-07-29 04:03:34 +02:00
parent 1be7329301
commit c58f6c54ce
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
3 changed files with 18 additions and 13 deletions

View file

@ -62,14 +62,14 @@ export default function Progress({ job, onCancel, onReset, isCancelling }: Progr
<>
<p className="text-text-secondary">
{localize('com_ui_import_report', {
0: job.report.imported,
1: job.report.skipped,
count: job.report.imported,
skipped: job.report.skipped,
})}
</p>
<p className="text-text-secondary">
{localize('com_ui_import_report_assets', {
0: job.report.assetsImported,
1: job.report.assetsUnavailable,
count: job.report.assetsImported,
unavailable: job.report.assetsUnavailable,
})}
</p>
</>
@ -116,7 +116,7 @@ export default function Progress({ job, onCancel, onReset, isCancelling }: Progr
{isTerminal && job.report && job.report.errors.length > 0 && (
<details>
<summary className="cursor-pointer text-sm text-text-secondary">
{localize('com_ui_import_errors', { 0: job.report.errors.length })}
{localize('com_ui_import_errors', { count: job.report.errors.length })}
</summary>
<ul className="mt-2 list-inside list-disc text-sm text-text-secondary">
{job.report.errors.map((error, index) => (

View file

@ -57,11 +57,11 @@ export default function Summary({
{localize('com_ui_import_detected', { 0: sourceLabel })}
</h3>
<ul className="grid grid-cols-2 gap-x-4 gap-y-2 text-sm text-text-secondary">
<li>{localize('com_ui_import_stat_conversations', { 0: summary.conversations })}</li>
<li>{localize('com_ui_import_stat_conversations', { count: summary.conversations })}</li>
<li>
{localize('com_ui_import_assets', {
0: summary.assets,
1: formatAssetSize(summary.assetBytes),
count: summary.assets,
size: formatAssetSize(summary.assetBytes),
})}
</li>
<li>{localize('com_ui_import_stat_archived', { 0: summary.archived })}</li>

View file

@ -1286,7 +1286,8 @@
"com_ui_image_gen_failed": "Image generation failed",
"com_ui_import": "Import",
"com_ui_import_another": "Import another file",
"com_ui_import_assets": "{{0}} attachments ({{1}})",
"com_ui_import_assets": "{{count}} attachments ({{size}})",
"com_ui_import_assets_one": "{{count}} attachment ({{size}})",
"com_ui_import_cancel": "Cancel import",
"com_ui_import_cancelled": "Import cancelled",
"com_ui_import_conversation_error": "There was an error importing your data",
@ -1295,18 +1296,22 @@
"com_ui_import_conversation_upload_error": "Error uploading file. Please try again.",
"com_ui_import_detected": "Detected {{0}} export",
"com_ui_import_drop": "Drop your export here to import",
"com_ui_import_errors": "{{0}} items could not be imported",
"com_ui_import_errors": "{{count}} items could not be imported",
"com_ui_import_errors_one": "{{count}} item could not be imported",
"com_ui_import_lost": "This import could not be found. It may have already finished or expired.",
"com_ui_import_phase_assets": "Importing attachments",
"com_ui_import_phase_conversations": "Importing conversations",
"com_ui_import_progress_of": "{{0}} of {{1}}",
"com_ui_import_report": "{{0}} conversations imported, {{1}} skipped",
"com_ui_import_report_assets": "{{0}} attachments imported, {{1}} unavailable",
"com_ui_import_report": "{{count}} conversations imported, {{skipped}} skipped",
"com_ui_import_report_assets": "{{count}} attachments imported, {{unavailable}} unavailable",
"com_ui_import_report_assets_one": "{{count}} attachment imported, {{unavailable}} unavailable",
"com_ui_import_report_one": "{{count}} conversation imported, {{skipped}} skipped",
"com_ui_import_source_chatgpt": "ChatGPT",
"com_ui_import_source_claude": "Claude",
"com_ui_import_source_grok": "Grok",
"com_ui_import_stat_archived": "{{0}} archived",
"com_ui_import_stat_conversations": "{{0}} conversations",
"com_ui_import_stat_conversations": "{{count}} conversations",
"com_ui_import_stat_conversations_one": "{{count}} conversation",
"com_ui_import_stat_starred": "{{0}} starred",
"com_ui_importing": "Importing",
"com_ui_include_shadcnui": "Include shadcn/ui components instructions",