Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify JavaScript to pluralize translations #3809

Merged
merged 5 commits into from
Nov 1, 2019
Merged

Simplify JavaScript to pluralize translations #3809

merged 5 commits into from
Nov 1, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Oct 31, 2019

References

Background

We were using two different systems to set translations in JavaScript: to set the text for languages, we were using data attributes, and to set the text for staff members, we were using AJAX calls.

Objectives

Simplify and unify the way we pluralize translations in JavaScript.

We can pass the whole translation hash instead of passing descriptions
individually, and we can replace `%{count}` so we don't need any <span>
tags.
This way we can reuse it in other places.
This way we can have a generic function we can apply in other places.
@javierm javierm self-assigned this Oct 31, 2019
@javierm javierm added this to Reviewing in Roadmap via automation Oct 31, 2019
We were using two different systems to set translations in JavaScript:
to set the text for languages, we were using data attributes, and to set
the text for staff members, we were using AJAX calls.

I find data attributes keep the code more simple, since there's no need
to define an extra route and controller action. Furthermore, the user
experience is better because response times are faster.

So now both places use data attributes.
@javierm javierm merged commit 5812138 into master Nov 1, 2019
Roadmap automation moved this from Reviewing to Release 1.1.0 Nov 1, 2019
@javierm javierm deleted the pluralize_js branch November 1, 2019 15:48
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Simplify JavaScript to pluralize translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

None yet

1 participant