0

I am currently trying to extends the Ralyxa gem to support multiple languages in the intents as well the directives.

The basic idea is something like this:

intent "SendMessage" do
  locale 'es-MX' do
    respond("es-MX")
  end
  locale 'en-IN' do
    respond("en-IN")
  end
end

I discovered that the feature need to be implemented somehow in the https://github.com/sjmog/ralyxa/blob/master/lib/ralyxa/skill.rb, but I am not yet sure where I should add such feature since is a subset of commands of intent.

Paco V.
  • 87
  • 7

1 Answers1

0

Awesome that you want to add locale handling to Ralyxa. You might want to add a locale method here: https://github.com/sjmog/ralyxa/blob/master/lib/ralyxa/handler.rb

All the intent methods, like respond, tell and card are defined here - you may need to define a locale method taking a block, which constructs a special Ralyxa::Handler instance for that locale.

Happy to review a Pull Request if you get round to implementing it!

(If you didn’t want to modify the base Ralyxa code, you might be able to simply use an if...else block to redirect the control flow depending on the locale.)

Sam Morgan
  • 228
  • 1
  • 11