Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Simplify i18n #763

Merged
merged 3 commits into from
Nov 19, 2017
Merged

Simplify i18n #763

merged 3 commits into from
Nov 19, 2017

Conversation

stanislas-m
Copy link
Member

  • Use the t helper for every case (no more tp).
  • Load languages & translator function in the middleware, so the Translate function can be used inline; even in Go code.
  • Get closer to the i18n function interface, by forwarding variadic arg (plush already fixed for that).
  • Use the user data as context values, not Buffalo context (not precise enough in a loop, for instance).

This introduces a breaking change, because the tp helper is removed, and the i18n helpers return only a string now.

- Use the `t` helper for every case (no more `tp`).
- Load languages & translator function in the middleware, so the Translate function can be used inline; even in Go code.
- Get closer to the i18n function interface, by forwarding variadic arg (plush already fixed for that).
- Use the user data as context values, not Buffalo context (not precise enough in a loop, for instance).
@stanislas-m stanislas-m added breaking change This feature / fix introduces breaking changes enhancement New feature or request labels Nov 18, 2017
@markbates
Copy link
Member

I think these tests are failing because the docker image doesn't have the latest version of Plush on it. I just kicked off a rebuild of the image on docker hub. Once that's done you can retry the tests.

https://hub.docker.com/r/gobuffalo/buffalo/builds/

@markbates
Copy link
Member

Other than the tests, things look good, so I'll happily merge once the tests are passing.

@markbates markbates added this to the 0.10.2 milestone Nov 18, 2017
@stanislas-m
Copy link
Member Author

@markbates Seems good now! :)

@markbates markbates merged commit ea3de19 into development Nov 19, 2017
@markbates markbates deleted the simplify-i18n branch November 19, 2017 00:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This feature / fix introduces breaking changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants