Ruby + replace from array lines

Hello there.
First of all i am not even sure if its possible, but figured - should still ask.
so.. i have two fields.

  1. String with text:
    {field1} = "Some text from blah X.KEY1 Some more text X.KEY2 and text here... "
  2. Array with translation
    "Regions" => [
    [0] "KEY1-good",
    [1] "KEY2-good"
    I want to translate KEY1 in field1 into KEY1-good and KEY2 into KEY2-good.

The trick is - i do not know how many "keys" can be in the {field1}. Plus they can be almost the same so translate filter wont work.
But position in {Regions} always right. so %{[Regions][0]} is KEY1 in %{field1} and so on...
I though i should use ruby, but cant figure out how? should it be .map or gsub? and how can i corelate position in %{Region} and position in ruby scan?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.