mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
revert(import): drop the plural count keys
Removes com_ui_import_assets_one, com_ui_import_errors_one,
com_ui_import_report_assets_one, com_ui_import_report_one and
com_ui_import_stat_conversations_one, and returns the call sites to
positional interpolation so no key is left referencing {{count}}.
This commit is contained in:
parent
7d0d7753bb
commit
f9d0c5fbb4
4 changed files with 16 additions and 43 deletions
|
|
@ -62,14 +62,14 @@ export default function Progress({ job, onCancel, onReset, isCancelling }: Progr
|
|||
<>
|
||||
<p className="text-text-secondary">
|
||||
{localize('com_ui_import_report', {
|
||||
count: job.report.imported,
|
||||
skipped: job.report.skipped,
|
||||
0: job.report.imported,
|
||||
1: job.report.skipped,
|
||||
})}
|
||||
</p>
|
||||
<p className="text-text-secondary">
|
||||
{localize('com_ui_import_report_assets', {
|
||||
count: job.report.assetsImported,
|
||||
unavailable: job.report.assetsUnavailable,
|
||||
0: job.report.assetsImported,
|
||||
1: 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', { count: job.report.errors.length })}
|
||||
{localize('com_ui_import_errors', { 0: job.report.errors.length })}
|
||||
</summary>
|
||||
<ul className="mt-2 list-inside list-disc text-sm text-text-secondary">
|
||||
{job.report.errors.map((error, index) => (
|
||||
|
|
|
|||
|
|
@ -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', { count: summary.conversations })}</li>
|
||||
<li>{localize('com_ui_import_stat_conversations', { 0: summary.conversations })}</li>
|
||||
<li>
|
||||
{localize('com_ui_import_assets', {
|
||||
count: summary.assets,
|
||||
size: formatAssetSize(summary.assetBytes),
|
||||
0: summary.assets,
|
||||
1: formatAssetSize(summary.assetBytes),
|
||||
})}
|
||||
</li>
|
||||
<li>{localize('com_ui_import_stat_archived', { 0: summary.archived })}</li>
|
||||
|
|
|
|||
|
|
@ -381,14 +381,13 @@ describe('Import panel', () => {
|
|||
|
||||
render(<Import />);
|
||||
/* Exactly once: the count is the <details> summary. It used to also be
|
||||
repeated in the status block above, which this assertion enshrined.
|
||||
Singular, because a single failure is one item, not "1 items". */
|
||||
expect(screen.getAllByText(/^1 item could not be imported$/i)).toHaveLength(1);
|
||||
repeated in the status block above, which this assertion enshrined. */
|
||||
expect(screen.getAllByText(/^1 items could not be imported$/i)).toHaveLength(1);
|
||||
expect(screen.getByText(/conversation 11 malformed/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/archive truncated/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('pluralizes the error count for more than one failure', () => {
|
||||
it('shows the error count for more than one failure', () => {
|
||||
dataProvider.useImportJobQuery.mockReturnValue({
|
||||
data: job({
|
||||
phase: 'failed',
|
||||
|
|
@ -408,27 +407,6 @@ describe('Import panel', () => {
|
|||
expect(screen.getByText(/^2 items could not be imported$/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('pluralizes the report counts, so a single conversation is not "1 conversations"', () => {
|
||||
dataProvider.useImportJobQuery.mockReturnValue({
|
||||
data: job({
|
||||
phase: 'completed',
|
||||
status: 'completed',
|
||||
report: {
|
||||
imported: 1,
|
||||
skipped: 0,
|
||||
assetsImported: 1,
|
||||
assetsUnavailable: 0,
|
||||
errors: [],
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
render(<Import />);
|
||||
|
||||
expect(screen.getByText('1 conversation imported, 0 skipped')).toBeInTheDocument();
|
||||
expect(screen.getByText('1 attachment imported, 0 unavailable')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('moves focus back to the import control after starting another import', () => {
|
||||
dataProvider.useImportJobQuery.mockReturnValue({
|
||||
data: job({
|
||||
|
|
|
|||
|
|
@ -1286,8 +1286,7 @@
|
|||
"com_ui_image_gen_failed": "Image generation failed",
|
||||
"com_ui_import": "Import",
|
||||
"com_ui_import_another": "Import another file",
|
||||
"com_ui_import_assets": "{{count}} attachments ({{size}})",
|
||||
"com_ui_import_assets_one": "{{count}} attachment ({{size}})",
|
||||
"com_ui_import_assets": "{{0}} attachments ({{1}})",
|
||||
"com_ui_import_cancel": "Cancel import",
|
||||
"com_ui_import_cancelled": "Import cancelled",
|
||||
"com_ui_import_conversation_error": "There was an error importing your data",
|
||||
|
|
@ -1296,22 +1295,18 @@
|
|||
"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": "{{count}} items could not be imported",
|
||||
"com_ui_import_errors_one": "{{count}} item could not be imported",
|
||||
"com_ui_import_errors": "{{0}} items 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": "{{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_report": "{{0}} conversations imported, {{1}} skipped",
|
||||
"com_ui_import_report_assets": "{{0}} attachments imported, {{1}} unavailable",
|
||||
"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": "{{count}} conversations",
|
||||
"com_ui_import_stat_conversations_one": "{{count}} conversation",
|
||||
"com_ui_import_stat_conversations": "{{0}} conversations",
|
||||
"com_ui_import_stat_starred": "{{0}} starred",
|
||||
"com_ui_importing": "Importing",
|
||||
"com_ui_include_shadcnui": "Include shadcn/ui components instructions",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue