[geeklog-devel] CrowdTranslation-LANG array mapping

Benjamin Talic b.ttalic at gmail.com
Fri Jun 21 17:17:04 EDT 2013


Hi All,

Again I have run into a problem with the plugin. I have been trying to
figure out a good solution for days...

The problem:
Once a page is loaded the plugin should kick in and find all text which is
essentially from the LANG arrays from the language file.
All the solutions I have come up with are bad and I have run out of ideas.

Here is what I have:

1) Assuming that the default site language will not change put all the LANG
files inside a database table (also saving the data from which array it
originally came and under which index).
Later on use the text (or HTML) of the shown page to find all matches
between what is displayed to the user and what is in the database table.
The same thing could somewhat be improved if I would use a persistent PHP
array so that the database is queried only once.

2) Have a list of all available LANG arrays and loop through them to find
macing strings. This would probably take a very long time.

Both approaches have the same problem, if the page contains a story/comment
with the text "We could save the city" it could identify the save from that
sentence as a element of the LANG32 array.

Any nudge in the right direction would be much appreciated...

Thanks in advance
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20130621/9726e74e/attachment.html>


More information about the geeklog-devel mailing list