blocknotes / tiny_admin

A compact and composable dashboard component for Ruby
MIT License
12 stars 0 forks source link

feat: translations support #30

Closed blocknotes closed 1 year ago

blocknotes commented 1 year ago

In this PR:

The default implementation of label_for uses the fallback string. A possible override when using the component in a Rails application could be:

class Helper < TinyAdmin::Support
  class << self
    def label_for(value, options: [])
      options&.first ? ::I18n.t(options.first, default: value) : value
    end
  end
end