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.

Comments

danielnolde’s picture

StatusFileSize
new3.09 KB

patch attached

JacobSingh’s picture

Thanks! I only have one nit:

$form['providers'][$key] = array('#markup' => theme('image', array('path' => $provider['image'], 'title' => t($provider['title']))));

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?

JacobSingh’s picture

Status: Active » Needs work

@danielnolde: Bump! Please comment when you get a chance.

floretan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.98 KB

Rerolled patch (the name of the javascript file has changed). The call to t() for provider names has been removed.

effulgentsia’s picture

Status: Needs review » Postponed
+++ modules/media_internet/media_internet.module
@@ -87,13 +87,13 @@ function media_internet_add($form, &$form_state = array(), $types = NULL) {
-  $form['providers']['header'] = array('#markup' => '<h2> Supported Providers </h2>');
+  $form['providers']['header'] = array('#markup' => '<h2> ' . t('Supported Providers') . ' </h2>');

This 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.

dave reid’s picture

Status: Postponed » Fixed

Yeah 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.