apsislabs / phi_attrs

HIPAA compliant PHI access logging for Ruby on Rails.
MIT License
27 stars 3 forks source link

I18n Support #29

Closed Crisfole closed 5 years ago

Crisfole commented 5 years ago

We frequently find ourselves grabbing translations based on our current location:

class FoobarController < ApplicationController
  # ...
  def bazify
    # ...
    reason = t('foobar.bazify.phi_reason')
    # ...
  end
end

Or when we use slayer:

class FrooFrooCommand < Slayer::Command
  def call
    reason = I18n.t('commands.froofroo.phi_reason')
    # ...
  end
end

For at least controllers, commands, and services this should be formalized so that a null reason gets automatically filled out with a translation if present.

egreer commented 5 years ago

I think that may be outside the scope of this gem, but I'd like to hear more about how you visualize the link between location and the PHI_reason working.