slim
slim copied to clipboard
Suggestion: Improve documenation and visibility for translator plugin
Hi,
I just started to use slim, and found out about the automatic i18n that can be done with the translator. This is a killer feature for me, and I wish the documentation would be a little more specific and perhaps consider Rails (or maybe add documentation in the slim-rails gem)
I found this related closed ticket and I am still opening a new one here to a) mention that there IS an interest in this plugin, and b) to offer more specific improvements.
I am not talking about a huge change, but this is where I think it could improve:
- Add specific instructions on where to require "slim/translator". I guess this is more relevant to Rails, and at first I just added it in the application controller, and only by getting to this ticket I learned I can require it through the gemfile - although I had to dig deeper to realize I need to do it like this:
gem 'slim-rails', require: ['slim-rails', 'slim/translator']
- Be more specific about what it translates. Is it just static strings? Is there a shortcut way to use it inside dynamic code, like
= link_to
or other cases? - Be more specific about what can/should be written as a static-string-to-be-translated. I see some confusion about it in some tickets. It should probably mention that we can simply write the string that we would otherwise put inside the
t()
method (likeuser.delete_my_account
)
yes, please create documentation if you have time!
I am going through the Slim issues. This issue hasn't seen an update for a long time and the translator plugin isn't widely used.