Bug 1047215 - [Gallery/Video]Background Overlays are not translated

This PR incorporates the patch from bug 1038984 as those changes to dialogs.js are required for this patch.
This, however, is incorrect. This is shared code and the gallery app uses options[prefix + 'Text'] as originally written, not options[prefix + 'Id']. This will break the tests.