Skip to content

Commit 6cfa374

Browse files
committed
fix(sourceLanguage): set to optional to prevent Zod error
1 parent c882fff commit 6cfa374

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

projects/packages/text-transformer/info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ https://github.com/Avivbens/alfredo</string>
24342434
</dict>
24352435
</array>
24362436
<key>version</key>
2437-
<string>5.4.2</string>
2437+
<string>5.5.2</string>
24382438
<key>webaddress</key>
24392439
<string>https://github.com/Avivbens/alfredo</string>
24402440
</dict>

projects/packages/text-transformer/src/main/translate/translate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function parseLanguageFromInput(input: string): ParsedTranslationInput {
9999
translateResultSchema,
100100
);
101101

102-
const subtitle = `${sourceLanguage} => ${targetLanguage}`;
102+
const subtitle = sourceLanguage ? `${sourceLanguage} => ${targetLanguage}` : `Translated to ${targetLanguage}`;
103103
const items: AlfredListItem[] = [
104104
{
105105
title: translation,

projects/packages/text-transformer/src/models/translate-results.schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const translateResultSchema = z.object({
44
translation: z.string(),
55
sourceLanguage: z
66
.string()
7+
.optional()
78
.describe(
89
'The original language of the provided text. Should be the full name of the language, e.g., "English", "Spanish", "French".',
910
),

0 commit comments

Comments
 (0)