[geeklog-devel] CrowdTranslation-LANG array mapping
Dirk Haun
dirk at haun-online.de
Sat Jun 22 10:56:09 EDT 2013
Ben wrote:
> The easiest way for me would be to "simply" go through the source code and add a span everywhere where a LANG array is called
You could do that at runtime (see code snippet below). May need a new plugin api somewhere, though, depending on when exactly you wanted to do it.
> would become
>
> $edit_icon = '<img src="' . $_CONF['layout_url'] . '/images/edit.'
> . $_IMAGE_TYPE . '" alt="' ."<span class="translator">". $LANG01[48] ."</span>"
> . '" title="'."<span class="translator">" . $LANG01[48] ."</span>" . '"' . XHTML . '>';
And that's a problem right there: The <span> tag is not allowed inside a title attribute. Same goes for button texts and a few other things. So there are some text strings that have to stay plain text. I'm afraid figuring out which ones at runtime is pretty much impossible.
Hmm …
bye, Dirk
--- snip ---
<?php
$LANG42 = array(
1 => 'Hello',
2 => 'World'
);
echo $LANG42[1] . "\n\n";
$_lang42 = array();
foreach ($LANG42 as $key => $value) {
$_lang42[$key] = '<span>' . $value . '</span>';
}
$LANG42 = $_lang42;
echo $LANG42[1] . "\n\n";
?>
--- snip ---
--
http://www.themobilepresenter.com/
More information about the geeklog-devel
mailing list