This is probably a dumb question, but my slight OCD is kicking in.
I created a plugin but only the first word of the name is capitalized.
I looked at a few other plugin.rb files and don’t see any capitalized words in there or in /config/settings.yml either.
Is there another file I need to create to do what I want?
You can probably do this with CSS.
You can target the plugin name element and use text-transform: capitalize
. This will make the words in captitals.
[I’m on mobile right now so I can’t check the element]
That would fix it on my site, but if you install my plugin, it would still be broken on your site.
I’m looking for a solution to adjust the plugin itself, I don’t think other plugins are using CSS to achieve this.
Hmm… I have some sort of an idea on why this happens, but to be sure, can I know what plugin has this problem?
I built a custom plugin. I’d like to eventually share it with the community, but I’d like to fix at least this one thing that’s giving me Forrest Whitacre eye before I do so.
Is it possible to send your yml file for the settings, or the locale file?
Thanks.
I just sent it via DM.
Well, if I install your plugin and every word is captilized, from my, and majority of the world, point of view your plugin is broken that way.
You can’t win. You have to choose if you want to do how you want or how most of the globe works
Not a major question, though.
This is a hint
Discourse plugin names and settings are lowercase as a convention.
I wasn’t sure what the current convention was for the name displayed on the /plugins
page. There seems to be a mix of sentence and title case for different ones (eg Data explorer v Documentation Categories)
If this is about the display name, this is how it works.
If your plugin has metadata # name: discourse-foo-bar
in plugin.rb
,
Then the plugin will be shown as “Foo bar”
But you can override this in locales/client.XX.yml
en:
admin_js:
admin:
site_settings:
categories:
discourse_foo_bar: "Discourse Foo Bar Blah"
The plugins will be sorted by what comes after discourse- though.
What about the
?
-
admin_js.admin.site_settings.categories.discourse_foo_plugin
→ name in/admin/plugins
list -
js.discourse_foo_plugin.title
→ title in plugin admin screen (/admin/plugins/discourse-foo-plugin
) -
js.discourse_foo_plugin.admin_navigation
→ name in admin sidebar
Got it, thanks for clarifying!
Yes, display name.
I have this in a config/locales/client.en.yml
file, I rebuilt, and there was no change.
en:
admin_js:
admin:
site_settings:
categories:
auto_remove_group: "Auto Remove User from Group"
site_settings:
auto_remove_group_enabled: Enable the Auto Remove User from Group plugin.
auto_remove_group_category_id: Set the category ID number you are watching for posts. It can be found in the URL when you navigate to a category.
auto_remove_group_name: Set the group you want the user to be removed from once they post in category selected above.
Actually, the general consensus is that each word in a title is capitalized.
And yet it isn’t. That is an american way, came from news.
Well, out of the 10 plugins I have installed that are more than one word, 7 are capitalized.
And many more in the plugins section of this site follow that convention. And that’s what I want mine to look like.
Your key is auto_remove_group
but your #name
in your plugin.rb
is discourse-auto-remove-group
.
Try prefixing the key with discourse_