18F/identity-idp

View on GitHub
app/services/link_locale_resolver.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

class LinkLocaleResolver
  def self.locale
    locale = I18n.locale
    locale == I18n.default_locale ? nil : locale
  end

  def self.locale_options
    if I18n.locale == I18n.default_locale
      {}
    else
      { locale: I18n.locale }
    end
  end
end