File size: 2,543 Bytes
cbca414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
export const SRT_TRANSLATOR_PROMPT = (sourceLanguage, targetLanguage) => {
    const isTargetBurmese = targetLanguage.toLowerCase().includes('burm') || targetLanguage.includes('မြန်မာ');
    const burmeseRules = isTargetBurmese ? `
STRICT BURMESE SRT RULES (MANDATORY OUTPUT STYLE):
- STYLE: Professional Subtitling Style (Native-like).
- TONE: Differentiate between Narration and Dialogue based on content.
- PRONOUNS: Use common conversational terms like "ငါ", "မင်း", "သူ", "ကျွန်တော်", "ရှင်" based on inferred character relationships.
- ENDINGS: Strictly NO formal markers like 'သည်', '၏', 'သော', '၌'.
- CONVERSATIONAL ENDINGS: Use only 'ပါတယ်', 'တာပါ', 'တယ်', 'တာပေါ့', 'ဖြစ်နေတာ', 'သွားပြီ', 'လေ', 'နော်', 'ဦးမှာလား', 'လိုက်တာ'.
- DIALOGUE vs NARRATION: 
  * If it's a direct conversation (e.g., "How are you?"): Translate naturally as "နေကောင်းလား" or "ဘယ်လိုလဲ နေကောင်းရဲ့လား". 
  * If it's narration: Use an engaging storytelling flow but keep it concise for subtitles.
- FLOW: The translation must sound like a native Burmese speaker is saying those lines in a movie context. NO literal or "Google Translate" style.
` : `
GENERAL RULES FOR ${targetLanguage}:
- Maintain a natural, cinematic flow.
- Ensure the translation fits the context of movie subtitles (concise and easy to read).
- Use conversational phrasing appropriate for the target culture.
`;
    const sourceContext = sourceLanguage === 'Auto'
        ? "Detect the source language of the SRT content automatically."
        : `The source language is ${sourceLanguage}.`;
    return `
Task: Translate the provided SRT (SubRip) subtitle content into ${targetLanguage}.

CONTEXT:
- ${sourceContext}
- Target: ${targetLanguage}

STRICT TECHNICAL REQUIREMENTS:
1. PRESERVE TIMESTAMPS: You MUST keep the original timestamps (e.g., 00:00:01,000 --> 00:00:04,000) exactly as they are.
2. PRESERVE INDEXES: Do not change the sequence numbers.
3. OUTPUT FORMAT: The output must be a VALID SRT file.
4. CONTENT ACCURACY: Translate the meaning faithfully but adapt to the natural flow of the target language.

${burmeseRules}

INSTRUCTIONS:
- Analyze the scene context. Is it action? A joke? Emotional? Adjust word choice to match the "vibe".
- Return ONLY the translated SRT text. DO NOT include any labels, notes, or meta-talk.
`;
};