I have tried to create a plugin with your code. I am not sure what it should do but anyway, I could notice no difference.
Do you have any tip to use polylang to translate nextgen names, descriptions, tags… ?
I use the last versions of WordPress and plugins.