motor-admin-rails icon indicating copy to clipboard operation
motor-admin-rails copied to clipboard

Add support for Brazilian Portuguese

Open ruanltbg opened this issue 3 years ago • 3 comments

The actual file only loads if I don't define the country pt. This adds support for the Brazilian Portuguese

--

It is basically the same file as the pt.yml

ruanltbg avatar Sep 19 '22 22:09 ruanltbg

@ruanltbg can we create symlink instead of copying a file?

omohokcoj avatar Sep 19 '22 22:09 omohokcoj

Of course we can, I will try to do that when I get to my personal computer, I did the MR directly on the github repo

ruanltbg avatar Sep 20 '22 12:09 ruanltbg

@omohokcoj reviewing this, I cannot add a link there as the root of the file changes from pt: to pt-BR:. Do you have any idea?

ruanltbg avatar Sep 20 '22 19:09 ruanltbg

@ruanltbg yeah you're right - looks like we can't use symlink because of pt: to pt-BR:. Actually i don't think creating a copy of pt.yml file is a good idea. Can you try to configure fallback locales in your app instead? Hope it should solve the problem: https://guides.rubyonrails.org/configuring.html#config-i18n-fallbacks config.i18n.fallbacks = { 'pt-BR': :pt }

omohokcoj avatar Oct 09 '22 09:10 omohokcoj

I do see what you mean, but to be fair, pt is wrong for pt-BR, pt is for Portugal Portuguese, pt-BR is for brazilian Portuguese, and the most correct way would be pt-PT. I did not change that because I don't want to break others code.

ruanltbg avatar Oct 10 '22 13:10 ruanltbg

@ruanltbg it doesn't seem like there will be many changes in the pr-BR motor.yml ? I think you can simply create some locales/motor-admin/pt-BR.yml to add fixes to the pt.yml default locale and combined with i18n.fallback it should solve the issue. Closing this PR since i'd prefer to avoid adding an almost identical yml locales file into the codebase.

omohokcoj avatar Oct 16 '22 11:10 omohokcoj