{#- The translation part of the dataset form. Shown only to someone who may edit the dataset (create one, on a new dataset), and only when the schema names languages to translate into. The findings come from the form as it is; the script (assets/js/translation-form.js) checks again when a text or a translation changes, asks the AI for translations, and puts a suggestion the editor uses into the form's input for its language. Nothing is saved until the dataset is saved. -#} {%- set section = h.ai_translation_form_section(data) -%} {%- if section -%} {% asset 'ai_translation/ai-translation-form' %} {% asset 'ai_translation/ai-translation-form-css' %} {#- The script's texts in the page's language: the same keys and English texts as STRINGS in translation-form.js (tests/test_i18n.py checks that the two lists match). -#} {%- set i18n = { 'findings_none': _('No translation is missing or out of date.'), 'findings_failed': _('The translations could not be checked.'), 'severity_error': _('Error'), 'severity_warning': _('Needs review'), 'severity_info': _('Information'), 'running': _('AI is translating…'), 'queued': _('Waiting for its turn with the AI…'), 'queued_position': _('Waiting in line: {count} before you…'), 'done': _('The suggestions are ready. Read each one before you use it.'), 'nothing': _('There was nothing to translate.'), 'failed': _('The translation could not be completed.'), 'timeout': _('The AI did not answer in time. Try again.'), 'lost': _('The connection was lost. Try again.'), 'language_failed': _('No suggestions in {language}: {error}'), 'heading_suggestions': _('Suggested translations'), 'heading_proposal': _('Proposal from {date}'), 'machine_note': _('Machine-translated: check each suggestion before you use it. Nothing is saved until you save the dataset.'), 'source_label': _('{language} (source)'), 'current_replaced': _('Now in the form, replaced when you use the suggestion: {text}'), 'current_added': _('Now in the form: {text}. Using the suggestion adds its keywords to these.'), 'suggestion_label': _('Suggestion ({language}), you can edit it'), 'field_language': _('{field} ({language})'), 'use': _('Use'), 'used': _('Used'), 'used_note': _('Added to the form. Save the dataset to keep it.'), 'blank': _('The suggestion is empty. Write a text, or leave the field as it is.'), 'field_missing': _('The form has no field for this translation.') } -%} {%- set severity = {'error': _('Error'), 'warning': _('Needs review'), 'info': _('Information')} -%} {%- set language_names = section.languages | map(attribute='label') | join(', ') -%}

{{ _('Translations') }}

{{ _('The title, description and keywords are written in {source} and translated into {languages}. The AI can suggest translations of the texts in the form; you read and edit each one, and nothing is saved until you save the dataset.').format(source=section.source_language_label, languages=language_names) }}

{%- if section.findings %} {%- else %}

{{ _('No translation is missing or out of date.') }}

{%- endif %}
{%- if section.proposal %}

{{ _('There is a translation proposal for this dataset from {date}. Use it here, or decide on it on the proposals page.').format(date=section.proposal.created) }}

{{ _('Translation proposals') }}

{%- endif %}
{%- if not section.proposal %} {{ _('Translation proposals for your datasets') }} {%- endif %}
{%- endif -%}