{{#extends "_layout"}}
    {{#override "menu"}}{{> _menu}}{{/override}}

    {{#override "content"}}
        {{l10n "On this page you can upload a custom translation file."}}

        <br />
        <br />

        {{> _errors}}

        {{#if stored}}
            <div id="form-message">{{l10n "Translation imported"}}</div>
        {{/if}}

        <form  method="post" action="{{route "translation_import_process"}}" enctype="multipart/form-data">
            {{csrfTokenInput}}

            <div>
                {{> _tabs}}

                <div class="form-wrapper">
                    <div class="form-header">
                        <div class="form-header-inwards"></div>
                    </div>

                    <div class="form-inwards">
                        <div class="form-fields">
                            {{l10n "For language:"}}<br/>
                            <select name="target">
                                {{#each localesList}}
                                    <option value="{{id}}"{{#ifEqual id ../formtarget}} selected="selected"{{/ifEqual}}>{{name}}</option>
                                {{/each}}
                            </select>
                        </div>

                        <div class="form-fields">
                            <div class="field">
                                <label for="override" class="field-label">{{l10n "Override existing translations"}}</label>
                                <div class="field-value">
                                    <input id="override" type="checkbox" name="override" value="on"{{#if formoverride}} checked="checked"{{/if}}/>
                                </div>
                                <label for="override" class="field-description"> &mdash; {{l10n "Replaces translated strings in the database with values from the imported file."}}</label>
                                <br clear="all"/>
                            </div>

                            <div class="field">
                                <label for="translation-file" class="field-label">
                                    {{l10n "Upload translation"}}<span class="required">*</span>
                                </label>
                                <div class="field-value">
                                    <input id="translation-file" type="file" name="translation_file" size="40" value="{{formtranslationFile}}" class="field-input"/>
                                </div>
                                <label for="translation-file" class="field-description"> &mdash; {{l10n "Choose the translation file to upload."}}</label>
                                <br clear="all"/>
                            </div>

                            <div class="form-button">
                                <input type="submit" name="save" class="submit-button-background save-button" value="{{l10n "Upload"}}"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-footer">
                        <div class="form-footer-inwards"></div>
                    </div>
                </div>
            </div>
        </form>
    {{/override}}
{{/extends}}