def set_locale
      @ui_locale = RailsEmailPreview.locale
      if !I18n.available_locales.map(&:to_s).include?(@ui_locale.to_s)
        @ui_locale = :en
      end
      begin
        locale_was  = I18n.locale
        I18n.locale = @ui_locale
        yield if block_given?
      ensure
        I18n.locale = locale_was
      end
    end
def set_locale
      @ui_locale = RailsEmailPreview.locale
      if !I18n.available_locales.map(&:to_s).include?(@ui_locale.to_s)
        @ui_locale = :en
      end
      begin
        locale_was  = I18n.locale
        I18n.locale = @ui_locale
        yield if block_given?
      ensure
        I18n.locale = locale_was
      end
    end
UI locale