Currently, the media browser for internet embeds like youtube are not translatable, neither most of the form elements nor the javascript-added fake-cancel button are passed through the necessary t()/Drupal.t() functions. The following patch (built against media-7.x-1.x-dev from 3rd of March) solves this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1101180_4_media_browser_translatable.patch | 1.98 KB | floretan |
| #1 | 1101180_media_browser_translatable.patch | 3.09 KB | danielnolde |
Comments
Comment #1
danielnolde commentedpatch attached
Comment #2
JacobSingh commentedThanks! I only have one nit:
Shouldn't actually be there. t() should never be used on variables. I know in this case, we are expecting a very limited set, but I'm thinking the providers themselves should be providing translated strings. So patches needed against media_youtube, media_flickr, etc.
Should I re-roll with those lines taken out?
Comment #3
JacobSingh commented@danielnolde: Bump! Please comment when you get a chance.
Comment #4
floretan commentedRerolled patch (the name of the javascript file has changed). The call to t() for provider names has been removed.
Comment #5
effulgentsia commentedThis part from #1 should be re-added. Otherwise, #4 looks great. But, I'm postponing this until #1139514: Overhaul the media browser code to not use an iframe, and be more understandable, maintainable, and extendable in the hopes of that issue landing soon. If it doesn't land in a reasonable time, I'll reconsider committing this simple bug fix regardless, and deal with resolving conflicts in that issue.
Comment #6
dave reidYeah I don't think this should be held up for #1139514: Overhaul the media browser code to not use an iframe, and be more understandable, maintainable, and extendable anymore. Committed #4 along with an additional Drupa.t('Submit') which was mysteriously missed in the patch even though it was in the surrounding code.
http://drupalcode.org/project/media.git/commit/a9e80c6
http://drupalcode.org/project/media.git/commit/58fc085