Skip to content

Support metadata in I18n message backend #212

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

Merged
merged 2 commits into from
Dec 19, 2019
Merged

Support metadata in I18n message backend #212

merged 2 commits into from
Dec 19, 2019

Conversation

robhanlon22
Copy link
Member

@robhanlon22 robhanlon22 commented Dec 18, 2019

  • Updates Dry::Schema::Messages::I18n#get to return a Hash including text and meta
  • Removes conditional from Dry::Schema::Messages::Abstract#lookup that disambiguated between Strings and Hashes since both backends now return Hashes
  • Supports Procs as I18n translations when metadata is present by using I18n.t rather than hash access when looking for text and meta values

resolves #208
resolves #210

* Updates Dry::Schema::Messages::I18n#get to return a Hash including
  text and meta
* Removes conditional from Dry::Schema::Messages::Abstract#lookup that
  disambiguated between a Strings and Hashes since both backends now
  returns Hashes
* Supports Procs as I18n translations when metadata is present by using
  I18n.t rather than hash access when looking for text and meta values
@solnic solnic merged commit d96be2c into dry-rb:master Dec 19, 2019
@solnic
Copy link
Member

solnic commented Dec 19, 2019

@robhanlon22 thank you for addressing these issues, this is very helpful! I released 1.4.2 that includes your fixes. Here's the full changelog https://github.com/dry-rb/dry-schema/releases/tag/v1.4.2

@robhanlon22 robhanlon22 deleted the i18n-metadata branch December 19, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants