Your original code modified to use table.insert (I assume that your table with options is called "optionsTable"):
Lua Code:
for _, craftKey in pairs(blackSmithingRules) do
table.insert(optionsTable, {
type = "dropdown",
name = getTranslated(craftKey),
choices = getTranslateTable(sendingType),
getFunc = function() return getTranslated(BankManager.Saved[craftKey][numProfile]) end,
setFunc = function(value) changeTranslateTable(value,craftKey,numProfile) end,
})
end
This code is basically the same as was suggested by Sasky.
Modified code if you use metatable as it is in HarvestMaps addon (again, I assume that you use "optionsTable"):
Lua Code:
for _, craftKey in pairs(blackSmithingRules) do
optionsTable:insert({
type = "dropdown",
name = getTranslated(craftKey),
choices = getTranslateTable(sendingType),
getFunc = function() return getTranslated(BankManager.Saved[craftKey][numProfile]) end,
setFunc = function(val) changeTranslateTable(val, craftKey, numProfile) end,
})
end