Not sure if this is a bug or just a
# avo-2
a
Not sure if this is a bug or just a configuration issue, but I've got an object called an MSA which is inflected in the inflections.rb file. In the sidebar and breadcrumb it's showing as expected, but the title on the index is not.

https://cdn.discordapp.com/attachments/740893011994738751/1131688167720894494/Screen_Shot_2023-07-20_at_4.43.20_PM.png

l
I guess the areas use different methods for labels
I wasn't able to reproduce that
I used
rails g model m_s_a
a
@lemon-wall-20836 So in this case our model is called
MSA
(
msa.rb
) and our avo controller is
MSAsController
(or
msas_controller.rb
), and our inflections file contains
Copy code
ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.acronym "MSA"
  inflect.acronym "MSAs"
end
Part of the issue with not being able to localize (I believe) is here: https://github.com/avo-hq/avo/blob/5d8b9109d43abcb9d1aa359c7761ad40fb82540d/lib/avo/base_resource.rb#L280 I think you want
.humanize
here (which is a Rails method which uses inflection) vs
.capitalize
which is a Ruby method which just dumbly capitalizes the first letter of the word.
Copy code
irb(main):106:0> "msa".capitalize
=> "Msa"
irb(main):107:0> "msa".humanize
=> "MSA"
irb(main):108:0> "MSA".capitalize
=> "Msa"
even with the localization in place, the all-caps string would get converted to what we see.
l
Ok. We’ll have a look. Thst sounds like a good solution
Thanks
a
i think you'd just have to change it in base_resource and base_field which both have the translation_key issue.
i opened an issue https://github.com/avo-hq/avo/issues/1858 just to track it