[geeklog-devel] CrowdTranslation-LANG array mapping

Benjamin Talic b.ttalic at gmail.com
Sun Jun 23 19:26:30 EDT 2013


Hi all,

I want to thank you for all the ideas I got. And for the patiance with this
project.
Some work on it has been done. If you are interested I have published it
here:
http://summergeeek.blogspot.com/2013/06/big-decisions.html
And will shortly update the wiki page:
http://wiki.geeklog.net/index.php/Crowdsourcing_Translations

Again thank you,
Ben

On Sat, Jun 22, 2013 at 8:39 PM, Niemans <niemans at nlbox.com> wrote:

> Another option would be to sit inside
> COM_createHTMLdocument/Template.class and let the template parser replace
> language dependencies.
>
> But if I understand correctly what everybody is saying, than the direction
> is a Language.class and/or a Translation.class.
> I.E. $LANG01[48] will become in the source code $LANG01->get(48) or alike.
> The object can respond depending on what is the case, and, important, can
> trace the use of every item.
>
> Here some interesting links on how this is done elsewhere:
>
> http://fuelphp.com/docs/classes/lang.html
>
> http://www.php4every1.com/tutorials/multi-language-site/
>
> Maybe this is useful for designing the API.
>
> Wim
>
>
> Op 22 jun. 2013, om 16:56 heeft Dirk Haun het volgende geschreven:
>
> > 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/
> >
> > _______________________________________________
> > geeklog-devel mailing list
> > geeklog-devel at lists.geeklog.net
> > http://eight.pairlist.net/mailman/listinfo/geeklog-devel
> >
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://eight.pairlist.net/mailman/listinfo/geeklog-devel
>



-- 
Regards,
Benjamin


home:         http://summergeeek.blogspot.com/   nvandgsoc.blogspot.com
skype:         benjamintalic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20130624/241739e6/attachment.html>


More information about the geeklog-devel mailing list