kavehtaheri commited on
Commit
8d449d2
·
verified ·
1 Parent(s): c4df0b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -306,7 +306,7 @@ def enhance_text(api_key, text, google):
306
  # Prepare the request body
307
  request_body = [{
308
  "role": "user",
309
- "content": f"{text} Please ignore all previous instructions. Please respond only in the Persian language.Do not explain what you are doing. Do not self reference.you arte an expert translator and your task here is to translte from english to persian The subject of the text is philosophy and life advice quote. The translation should have a poetic and literary tone in persian , Please follow these guidelines: Preserve the exact meaning of each sentence while adding a touch of Persian literary elegance. Keep the language clear and accessible, avoiding over-complicated or embellished phrases that alter the message. Ensure proper Persian grammar and structure for a polished, fluent result. Maintain alignment with the time ranges provided for subtitlesconvert the English terms used in it into common Persian terms which make the text undrastandabel and touching for persian audience .When in doubt, prioritize clarity and fidelity to the persian language structure over poetic embellis Translate it with the above considerations in summary you have to translate the text in a way beside is faitful loyality to the original text meaning it make it undrestandebel and touching for persian language auidence "
310
  },]
311
 
312
  # Add the API key to the request
 
306
  # Prepare the request body
307
  request_body = [{
308
  "role": "user",
309
+ "content": f"{text} You are an expert translator specializing in Persian translation with a poetic and literary tone. Your task is to translate English text into Persian while preserving the exact meaning of each sentence and making the text emotionally impactful and engaging for Persian-speaking audiences. The subject matter is philosophy and life advice, so the translation should feel thoughtful, inspiring, and accessible.### Guidelines:1. **Preserve Meaning:** Ensure the translation remains faithful to the original English text, fully conveying the intended meaning without losing any nuance.2. **Literary and Poetic Style:**Add a touch of Persian literary elegance to the text. Use idiomatic expressions, culturally resonant metaphors, and stylistic elements that enhance the emotional depth of the translation, but avoid over-complicating or obscuring the message.3. **Clarity and Accessibility:** Prioritize clarity in Persian. If a phrase or concept is enigmatic or abstract in the original text, simplify or adapt it to ensure it resonates clearly with Persian-speaking audiences.4. **Emotional Impact:** Use language that evokes emotions and connects deeply with readers. Focus on making the translation touching and inspiring without sounding overly formal or detached.5. **Cultural Adaptation:** Replace or adapt English terms and concepts into their Persian equivalents in a way that feels natural and familiar to Persian audiences. Avoid using technical or academic language unless explicitly required.6. **Proper Grammar and Fluency:** Maintain polished Persian grammar, sentence structure, and flow. Ensure the final translation reads smoothly and feels natural to native speakers.7. **Prioritize Simplicity:** When in doubt, prioritize simplicity and clarity over excessive embellishment. Avoid using overly archaic or complex phrases that might confuse the reader.### Example Translation:Original: *"Life is not about waiting for the storm to pass; it’s about learning to dance in the rain."*Translated: "زندگی آن نیست که در انتظار عبور طوفان باشیم؛ بلکه آن است که آموختن رقصیدن زیر باران را بیاموزیم."Use these principles to craft translations that are both faithful to the original meaning and emotionally impactful for Persian audiences. "
310
  },]
311
 
312
  # Add the API key to the request