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

Interpolate translation array #498

Merged
merged 4 commits into from
Jun 6, 2018
Merged

Interpolate translation array #498

merged 4 commits into from
Jun 6, 2018

Conversation

c100k
Copy link

@c100k c100k commented Jun 4, 2018

If the translation is an Array, the dynamic values were not interpolated.

If the translation is an `Array`, the dynamic values were not interpolated.
@PikachuEXE
Copy link

Can you add related test to prove your change is working?

@c100k
Copy link
Author

c100k commented Jun 5, 2018

Done ! Let me know if something more is needed.

@@ -598,6 +598,8 @@

if (typeof(translation) === "string") {
translation = this.interpolate(translation, options);
} else if (isArray(translation)) {
translation = translation.map((t) => this.interpolate(t, options));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. This () => something syntax is not ES5 syntax, please update it
  2. Please add shim for Array#map to app/assets/javascripts/i18n/shims.js

@c100k
Copy link
Author

c100k commented Jun 6, 2018

Done.

@PikachuEXE PikachuEXE merged commit db6d797 into fnando:master Jun 6, 2018
@PikachuEXE
Copy link

Thanks!

@PikachuEXE
Copy link

Released as gem and npm package 3.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants