diff --git a/locales/en/main.ftl b/locales/en/main.ftl index 1976bf7..4a1fd88 100644 --- a/locales/en/main.ftl +++ b/locales/en/main.ftl @@ -30,6 +30,19 @@ zone-content-new-record-button = New record ## Create record +new-record-title = New record + +record-creation-process-heading = Create a new record in zone { $zone } + +record-choose-name-heading = Choose the subdomain name of the new record + +record-input-name = + .input-label = Subdomain of the new record + .help-description = Only the subdomain, without the parent domain. For instance, "www" to create the subdomain "www.{ $zone }". + .error-domain-characters_not_permitted = Domain name label "{ $label }" contains characters not permitted. The allowed characters are lowercase alphanumeric characters (a-z and 0-9), the dash ('-'), the underscore ('_') and the forward slash ('/'). + +button-create-record-next-step = Next step + record-input-addresses = .input-label = IP address #{ $index } .error-record-parse-ip = Unexpected IP address format. The IP address diff --git a/locales/fr/main.ftl b/locales/fr/main.ftl index a92c269..aef3987 100644 --- a/locales/fr/main.ftl +++ b/locales/fr/main.ftl @@ -30,6 +30,19 @@ zone-content-new-record-button = Nouvel enregistrement ## Create record +new-record-title = Nouvel enregistrement + +record-creation-process-heading = Créer un nouvel enregistrement dans la zone { $zone } + +record-choose-name-heading = Choisir le nom du sous-domaine du nouvel enregistrement + +record-input-name = + .input-label = Sous-domaine du nouvel enregistrement + .help-description = Seulement le sous-domaine, sans le domaine parent. Par exemple, “www” pour créer le sous-domaine “www.{ $zone }”. + .error-domain-characters_not_permitted = Le segment “{ $label }” du nom de domain contient des caractères interdits. Les caractères autorisés sont les caractères alphanumériques (a-z et 0-9), le tiret (“-”), le tiret bas (“_”) et le slash (“/”). + +button-create-record-next-step = Étape suivante + record-input-addresses = .input-label = Adresse IP #{ $index } .error-record-parse-ip = Format d’adresse IP inconnu. L’adresse IP doit être diff --git a/src/resources/dns/friendly/create.rs b/src/resources/dns/friendly/create.rs index aeb42a3..cc78730 100644 --- a/src/resources/dns/friendly/create.rs +++ b/src/resources/dns/friendly/create.rs @@ -51,7 +51,10 @@ impl NewRecordQuery { errors, "/name" ); - self.name = new_name; + // Keep the old value if the name is invalid + if new_name.is_some() { + self.name = new_name; + } } } diff --git a/templates/pages/new_record.html b/templates/pages/new_record.html index 87cb7a6..1e5a317 100644 --- a/templates/pages/new_record.html +++ b/templates/pages/new_record.html @@ -1,10 +1,14 @@ {% extends "bases/app.html" %} {% import "macros/new_rrset.html" as new_rrset %} -{% block title %}New record - {{ current_zone }} - {% endblock title %} +{% block title %}{{ tr(msg="new-record-title", lang=lang) }} – {{ current_zone }} ‑ {% endblock title %} {% block main %} -