Spaces:
Sleeping
Sleeping
KevinIsInCoding Claude Sonnet 4.6 commited on
FIX: Prevent translation of hospital names and proper nouns in i18n mode (#3)
Browse filesLanguage directives now explicitly instruct Claude to translate only its own
explanatory text and never modify hospital/facility names, drug names, sponsor
names, investigator names, trial titles, NCT IDs, or any proper nouns from
trial data. Unsure cases default to keeping the original English.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- translations.py +14 -6
translations.py
CHANGED
|
@@ -62,21 +62,29 @@ UI: dict[str, dict[str, str]] = {
|
|
| 62 |
},
|
| 63 |
}
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
LANGUAGE_DIRECTIVE: dict[str, str] = {
|
| 66 |
"en": "",
|
| 67 |
"zh": (
|
| 68 |
"IMPORTANT: You must respond ONLY in Simplified Chinese (简体中文). "
|
| 69 |
-
"
|
| 70 |
-
"
|
| 71 |
),
|
| 72 |
"es": (
|
| 73 |
"IMPORTANTE: Debes responder ÚNICAMENTE en español. "
|
| 74 |
-
"
|
| 75 |
-
"
|
| 76 |
),
|
| 77 |
"hi": (
|
| 78 |
"महत्वपूर्ण: आपको केवल हिन्दी में उत्तर देना है। "
|
| 79 |
-
"
|
| 80 |
-
"
|
| 81 |
),
|
| 82 |
}
|
|
|
|
| 62 |
},
|
| 63 |
}
|
| 64 |
|
| 65 |
+
_PRESERVE = (
|
| 66 |
+
"NEVER translate or modify: hospital/facility names, drug/treatment names, "
|
| 67 |
+
"sponsor names, principal investigator names, trial titles, NCT IDs, "
|
| 68 |
+
"medical abbreviations (ALSFRS-R, FVC, SOD1, etc.), gene names, or any "
|
| 69 |
+
"other proper nouns from the trial data. Keep all of these exactly as-is. "
|
| 70 |
+
"If you are unsure whether something is a proper noun, leave it in English."
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
LANGUAGE_DIRECTIVE: dict[str, str] = {
|
| 74 |
"en": "",
|
| 75 |
"zh": (
|
| 76 |
"IMPORTANT: You must respond ONLY in Simplified Chinese (简体中文). "
|
| 77 |
+
"Translate only your own explanatory text — the words YOU write to the patient. "
|
| 78 |
+
f"{_PRESERVE}\n\n"
|
| 79 |
),
|
| 80 |
"es": (
|
| 81 |
"IMPORTANTE: Debes responder ÚNICAMENTE en español. "
|
| 82 |
+
"Traduce solo tu propio texto explicativo — las palabras que TÚ escribes al paciente. "
|
| 83 |
+
f"{_PRESERVE}\n\n"
|
| 84 |
),
|
| 85 |
"hi": (
|
| 86 |
"महत्वपूर्ण: आपको केवल हिन्दी में उत्तर देना है। "
|
| 87 |
+
"केवल अपना स्वयं का व्याख्यात्मक पाठ अनुवाद करें — वे शब्द जो आप रोगी को लिखते हैं। "
|
| 88 |
+
f"{_PRESERVE}\n\n"
|
| 89 |
),
|
| 90 |
}
|