Hi Alex,
Thanks for your code review. The answer is yes - there is a room for optimization which I was going to do in any case.
Answers:
1. Yes, it's a API key that needs to be present in order for Translation API to work. Currently I have hard-coded mine since need to figure out the difference between API Key used for Google Maps (configuration belongs to In-Link module) and the one I need here. I believe these are 2 different keys, but I'll check and merge it if needed.
2. Yes, comment will go away the same as the whole Agent part. Still need to run few more tests.
3. Translation Speed - yes it worked for me, but took quite a bit which is not acceptable for Production version. I am planning on changing the code to make fewer Curl requests by translating 10 or 20 labels at a time. By the way, how much data would be 5K? I have read that POST method for translation will support up to 5K, but haven't clearly converted it to any legitimate number to understand how much I can fit in a single request.
4. Yes, table will be moved out of the loop.
Cheers!
DA