Skip to content

Commit

Permalink
translate characters allowed and remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwoldatwork committed Sep 8, 2023
1 parent 9089c2d commit c72f8fd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
10 changes: 6 additions & 4 deletions app/views/components/forms/edit/_builder.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<i class="fa fa-check-circle" aria-hidden="true"></i> saved
</span>
<span class="counter-msg usa-hint usa-character-count__message" aria-live="polite">
<%= @instruction_text_limit %> characters allowed
<%= @instruction_text_limit %>
<%= t :characters_allowed %>
</span>
<br>
<span class="display-inline instructions-show">
Expand Down Expand Up @@ -61,7 +62,8 @@
<i class="fa fa-check-circle" aria-hidden="true"></i> saved
</span>
<span class="counter-msg usa-hint usa-character-count__message" aria-live="polite">
<%= @disclaimer_text_limit %> characters allowed
<%= @disclaimer_text_limit %>
<%= t :characters_allowed %>
</span>
<div id="disclaimer_text-show" tabindex="<%= @tabindex += 1 %>"><%= form.disclaimer_text.present? ? sanitize(form.disclaimer_text) : 'Survey Disclaimer Text' %></div>
</p>
Expand Down Expand Up @@ -343,10 +345,10 @@ function textCounter(field,maxlimit) {
var countfield = field.parentNode.querySelector(".counter-msg");
if ( field.value.length > maxlimit ) {
field.value = field.value.substring( 0, maxlimit );
countfield.innerText = '0 characters left';
countfield.innerText = '0 <%= t :characters_left %>';
return false;
} else {
countfield.innerText = "" + (maxlimit - field.value.length) + " characters left";
countfield.innerText = "" + (maxlimit - field.value.length) + " <%= t :characters_left %>";
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ end

<% if question.character_limit && question.character_limit > 0 %>
<span class="counter-msg usa-hint usa-character-count__message" aria-live="polite">
<%= question.max_length %> characters allowed
<%= question.max_length %>
<%= t :characters_allowed %>
</span>
<% end %>
</div>
4 changes: 2 additions & 2 deletions app/views/components/widget/_fba.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ function FBAform(d, N) {
var countfield = field.parentNode.querySelector(".counter-msg");
if ( field.value.length > maxlimit ) {
field.value = field.value.substring( 0, maxlimit );
countfield.innerText = '0 characters left';
countfield.innerText = '0 <%= t :characters_left %>';
return false;
} else {
countfield.innerText = "" + (maxlimit - field.value.length) + " characters left";
countfield.innerText = "" + (maxlimit - field.value.length) + " <%= t :characters_left %>";
}
},
loadButton: function()
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ en-US:
"yes": "yes"
"no": "no"
the_feedback_and_analytics_team: " the Feedback and Analytics Team"
characters_allowed: "characters allowed"
characters_left: "characters left"
form:
submit: "Submit"
submit_thankyou: "Thank you. Your feedback has been received."
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ es:
sign_in_text: Touchpoints usa Login.gov para manejar cuentas de usuario. Una vez que se autentique con Login.gov, se iniciará sesión y se le redirigirá a Touchpoints.
sign_in_with: Inicia sesión con
if_github: Si tiene una cuenta de GitHub,
characters_allowed: "caracteres permitidos"
characters_left: "caracteres restantes"
form:
submit: "Enviar"
submit_thankyou: "Gracias. Su comentario ha sido recibido."
Expand Down
2 changes: 2 additions & 0 deletions config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ zh-CN:
sign_in_text: Touchpoints 使用 Login.gov 来处理用户帐户。使用 Login.gov 进行身份验证后,您将登录并重定向回 Touchpoints。
sign_in_with: 登陆使用
if_github: 如果您有 GitHub 帐户,
characters_allowed: "允许的字符"
characters_left: "剩余字符数"
form:
submit: "提交"
submit_thankyou: "谢谢. 已收到您的反馈."
Expand Down

0 comments on commit c72f8fd

Please sign in to comment.