We are trying to add consistency code format across all app files and make code as simple as possible.
鈽猴笍
<%= f. label on forms views.*label: false on forms views.activerecord.yml for form translations.* Sometime we use <p class="help-text" and it's necessary maintain <%= f. label to put this <p> tag between <label> and <input>.
For example on /views/proposals/_form.html.erb:
Replace
<%= f.label :title, t("proposals.form.proposal_title") %>
<%= f.text_field :title, maxlength: Proposal.title_max_length, placeholder: t("proposals.form.proposal_title"), label: false, data: {js_suggest_result: "js_suggest_result", js_suggest: "#js-suggest", js_url: suggest_proposals_path}%>
to this 馃槏
<%= f.text_field :title,
maxlength: Proposal.title_max_length,
placeholder: t("proposals.form.proposal_title"),
data: {js_suggest_result: "js_suggest_result",
js_suggest: "#js-suggest",
js_url: suggest_proposals_path} %>
So, with this change you can remove t("proposals.form.proposal_title") i18n key from general.yml and move it to activerecord.yml (maybe some keys are already created 馃槈).
Please note that some proposals fields will be removed on https://github.com/consul/consul/issues/3182 (don't take care about them) 馃槈
We need include/move the i18n for en and es locales.
Run i18n-tasks health on console before open a PR to make sure all translation are in use and there are no missing translations.
If you make this issue open a different PR for each section (debates, proposals...) or at least difference them by commit (to make more easy to review) 馃檹 馃槍
Hi guys, I'd love to contribute to the project, may I start this one, or has someone else already started this work?
Hi @alceumedeiros! Nobody is working on it. All yours 鈽猴笍 . Thanks! 馃帀
One thing I notice, @decabeza described we should remove labels, whenever possible, and also remove the label: false attribute.
I noticed that when I do this, the new label used is the one found in (e.g. for Proposals):
activerecord:
attributes
proposal:
author: "Author"
title: "Title"
question: "Question"
description: "Description"
terms_of_service: "Terms of service"
Which has different translations from the ones we're currently using.
So t("proposals.form.proposal_title") is now Proposal Title. But if I remove this label, on the form it will be called Title now.
My question is, are we okay with the new translations or maybe I should change the attributes translations according to the ones currently in use?
cc: @microweb10
Hi @alceumedeiros,
Thank you very much for helping with this! 鈽猴笍
The texts should not change from a user experience perspective. So in those cases, please change the attributes translations in the file activerecord.yml according to the ones currently in use. 馃檹
Closed via #3746.
Most helpful comment
Hi @alceumedeiros,
Thank you very much for helping with this! 鈽猴笍
The texts should not change from a user experience perspective. So in those cases, please change the attributes translations in the file
activerecord.ymlaccording to the ones currently in use. 馃檹