I have created my own l($text) function in php for a multi lingual website. i use it like this in my documents :
echo '<h1>' . l('Title of the page') . '</h1';
echo '<p>' . l('Some text here...') . '</p>';
My question is, with a php script, how can i scan all my .php files to catch all this function usages and list all the arguments used into a mysql table?
the goal, of course, is to not forget any sentences in my traduction files.
I didn’t find anything on google or here, so if you have any ideas, or need some more information.
i just finished, your help was usefull ! 🙂
here is my ugly code for those who can be interested. it’s not beautifuly coded, but not made to be loaded 10000 times per day so…
small precision : i do have to escape various cases as :
-> CSS : background: url(‘image.jpg’);
and
-> jQuery : $(this).html(‘bla bla’);
so here is why the regex starts with [^a-z(] 🙂
it works very well now! just have to finish later with recording entries in a mysql table and ensure that i can load the script from time to time when there are changes on the site… keep the existing translation, overwrite the existing files etc… no problem with that.
thanks a gain, this website is really helpful ! 🙂