Edit Translations - Done
4 min

HTML
<div class="modal-background">
<div class="modal-container full">
<div class="modal-heading-container">
<h1 class="modal-h1">Manage Translations</h1>
<div>Review and customize the AI-generated translations for your PulseCheck questions</div>
</div>
<form id="edit-translations" name="edit-translations" method="get">
<div class="form-list max75vh">
<div class="form-field-container">
<div class="field-label-container">
<label for="english" class="field-label">English</label>
</div>
<textarea id="english" name="english" class="form-field text-area _3rem disabled w-input" disabled>{question text}</textarea>
</div>
<!-- START Language - Repeat for each Language -->
<div class="form-field-container">
<div class="field-label-container">
<div class="flex full space-between">
<label for="{language name}" class="field-label">{language name}</label>
<a class="flex small-gap">
<div class="icon _12 w-embed">
<svg fill="currentColor" width="12" height="12" viewbox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path class="cls-2" d="m19,22v-2h1v-7h-1v-2h4v2h-1v7h1v2h-4Z"></path><path class="cls-2" d="m15.5005,22h2l-3.5005-11h-3l-3.4966,11h1.9988l.6018-2h4.7781l.6184,2Zm-4.7947-4l1.6284-5.4111.2559-.0024,1.6736,5.4136h-3.5579Z"></path><polygon class="cls-2" points="32 4 28 4 28 0 26 0 26 4 22 4 22 6 26 6 26 10 28 10 28 6 32 6 32 4"><rect class="cls-2" x="30" y="12" width="2" height="2"></rect><rect class="cls-2" x="18" y="0" width="2" height="2"></rect><polygon class="cls-2" points="32 32 0 32 0 0 14 0 14 2 2 2 2 30 30 30 30 18 32 18 32 32"></polygon></polygon></svg>
</div>
<div class="text-extra-small">Regenerate Translation</div>
</a>
</div>
</div>
<textarea class="form-field text-area _3rem w-input" maxlength="5000" name="{language name}" id="{language name}" data-language="{language name}" required="">{translation of question}</textarea>
</div>
<!-- END Language -->
</div>
</form>
<div class="modal-close-button">
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</div>
</div>
</div>
Saving
- Evaluate save on loss of focus
- If changed and not null it should save
- If changed to null it should not save and should replace the text in the textarea with the current translation from the db.
Prompts
Regenerate Translation - Single Language
Model: Gemini 2.0 Flash
Please translate the following survey question from English to the specified language. The translation should maintain the original meaning and nuance while being culturally appropriate for speakers of the target language. Please provide only the translated question without explanations or additional commentary.
<input>
<english_question>{question}</english_question>
<target_language>{language}</target_language>
</input> Notes
For more info see Multi-language - Done