Skip to content

Commit 0fd79fe

Browse files
committed
Add SourceTexts and PluralForm fields to translation DTOs
- Add SourceTexts dictionary to TranslateRequestDto for UI edits - Add PluralForm field to TranslationResultDto for plural key support
1 parent 03c5b6c commit 0fd79fe

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

cloud/src/LrmCloud.Shared/DTOs/Translation/TranslateRequestDto.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ public class TranslateRequestDto
1212
/// </summary>
1313
public List<string> Keys { get; set; } = new();
1414

15+
/// <summary>
16+
/// Optional source texts for each key. When provided, these values are used instead of
17+
/// the saved database values. This allows translating unsaved edits from the UI.
18+
/// Key = key name (for non-plural) or "keyName:pluralForm" (for plural), Value = source text to translate.
19+
/// </summary>
20+
public Dictionary<string, string>? SourceTexts { get; set; }
21+
1522
/// <summary>
1623
/// Target language codes to translate to.
1724
/// </summary>

cloud/src/LrmCloud.Shared/DTOs/Translation/TranslateResponseDto.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public class TranslationResultDto
6666
/// </summary>
6767
public string TargetLanguage { get; set; } = string.Empty;
6868

69+
/// <summary>
70+
/// Plural form (e.g., "one", "other"). Empty for non-plural keys.
71+
/// </summary>
72+
public string PluralForm { get; set; } = string.Empty;
73+
6974
/// <summary>
7075
/// Original source text.
7176
/// </summary>

0 commit comments

Comments
 (0)