TrestleAdmin / trestle-auth

Authentication plugin for the Trestle admin framework
https://trestle.io
GNU Lesser General Public License v3.0
52 stars 23 forks source link

How to custom Siderbar links title and form fields name? #20

Closed hitobias closed 4 years ago

hitobias commented 5 years ago

First, thanks for your hard work. My question is how to custom the sider bar links title and form fields label? I'm use traditional Chinese, my customer need Chinese character.

sudoaza commented 4 years ago

Like this you edit the menu link in the app/admin/auth/user_admin.rb or whatever name you have

Trestle.resource(:users, model: User, scope: Auth) do
  menu do
    group :configuration, priority: :last do
      item :users, icon: "fa fa-users", label: "Not Users"
    end
  end
spohlenz commented 4 years ago

Another option is to edit your locale files (e.g. config/locales/zh-CN.yml).

The relevant i18n keys are:

So with an example block defined as:

group :configuration, priority: :last do
  item :users, icon: "fa fa-users"
end

Your locale file might look like:

en:
  admin:
    navigation:
      items:
        users: My Users

      groups:
        configuration: My Configuration