Acts Like Taggable On: Translate Tags

I work with RoR and I was wondering how can I translate Acts As Taggable into tags without having to manually insert them every time I use the tag again?

Example: I have a message (name and body in English), and I create it with the tags “shoes, dress, beauty”.
I have a header and body translated into Japanese into a text file, so I just need to copy / paste them (I use the Globalize2 plugin to manage translations).
Then I need to add Japanese tags, so I'm looking for a translation and add it.
Now I know how to write these three words in Japanese, but I do not want to translate them every time I use the same tag. The next time I create a message with the tag "shoes", I want the Japanese version to already have the translated term.

What are you offering? Abandon Acts As Taggable On and create a custom tag model with habtm relationships with Post? Subclass Acts as Taggable On Model?

Thanks in advance.

+3
source share
1 answer

You should be able to simply create your own controller, views and routes, as well as CRUD tags, as you see fit, adding all the fields you need to the db table, without having to subclass the tag model. Personally, if there isn’t any fancy cloud computing or so on with this plugin, I would throw your own as it is quite simple. It would also be a good exercise to view the plugin and understand its functionality.

0
source

Source: https://habr.com/ru/post/1763221/


All Articles