[G1] "AltText" in captionator not translatable

Yuan

Joined: 2003-12-03
Posts: 144
Posted: Wed, 2006-03-15 09:55

If I include "Alt Text / OnMouseOver" as an extra field, the field name for this in captionator is displayed as "AltText:" and is untranslatable. There is no msgid for AltText, even though there are several for "Alt Text / OnMouseOver".

This has been the case since at least 1.4.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2006-03-15 13:09

What exactly is untranslateable ?

The string "Alt Text / OnMouseOver", or the content of this field ?

Jens
--
Last Gallery v1 Developer and v1 translation manager.

 
Yuan

Joined: 2003-12-03
Posts: 144
Posted: Wed, 2006-03-15 16:55

I think the field name is somehow displayed on the page. I even looked into the source but can't find why the field name is displayed for this particular field, but for all others it displays strings. The net result is that there is one untraslated part on the page.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2006-03-15 18:11

I still can not follow you. :-(

Jens
--
Last Gallery v1 Developer and v1 translation manager.

 
Yuan

Joined: 2003-12-03
Posts: 144
Posted: Wed, 2006-03-15 20:54

Below are lines [292..299] of captionator.php:

Quote:
292: if ($field == "Title") {
293: echo "\n\t\t". '<div class="admin">' . _("Title") .': </div>';
294: echo "\n\t\t<input type=\"text\" name=\"extra_fields[$i][$field]\" value=\"$value\" size=\"40\">";
295: }
296: else {
297: echo "\n\t\t". '<br><span class="admin">'. _($field) .': </span><br>';
298: echo "\n\t\t<textarea name=\"extra_fields[$i][$field]\" rows=\"2\" cols=\"60\">$value</textarea>";
299: }

The following is a sample output from lines 297-298 in zh_CN, zh_TW, fr_FR, and de_DE:

Quote:
<br><span class="admin">AltText: </span><br>
<textarea name="extra_fields[1][AltText]" rows="2" cols="60">2005/10/31</textarea>

So all languages will display the field name "AltText" before the textarea box instead of any translation because there is none for this string.

After the above analysis, I found the fix: Just like the special treatment to a field called "Title", add the same treatment to "AltText", between original lines 295 and 296:

Quote:
elseif ($field == "AltText") {
echo "\n\t\t". '<div class="admin">' . _("Alt Text / onMouseOver") .': </div>';
echo "\n\t\t<textarea name=\"extra_fields[$i][$field]\" rows=\"2\" cols=\"60\">$value</textarea>";
}

Now the output changes with language and the page is fully translated.:-)

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2006-03-15 22:55

Thanks. You found again a bug.

Fixed (in a slightly different way) for 1.6

Jens
--
Last Gallery v1 Developer and v1 translation manager.