From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Sousa Newsgroups: gmane.emacs.help Subject: Re: Help with emacs scripting Date: Wed, 11 Apr 2012 01:22:50 +0100 Message-ID: References: <495248DFDEA08C469BBDED2D4AA6C61442552C@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04428ff444ae9b04bd5c3e06 X-Trace: dough.gmane.org 1334103806 26321 80.91.229.3 (11 Apr 2012 00:23:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 00:23:26 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Doug Lewan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 02:23:25 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SHlLF-00046m-B4 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 02:23:21 +0200 Original-Received: from localhost ([::1]:58219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlLE-0002yf-JP for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Apr 2012 20:23:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlL5-0002ss-EZ for help-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:23:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHlL3-0006sf-Dx for help-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:23:11 -0400 Original-Received: from sousa.cc ([46.51.181.120]:45680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlL3-0006s2-4p for help-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:23:09 -0400 Original-Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by sousa.cc (Postfix) with ESMTPSA id 8D85D204DF for ; Wed, 11 Apr 2012 00:23:06 +0000 (UTC) Original-Received: by wgbdr1 with SMTP id dr1so263466wgb.30 for ; Tue, 10 Apr 2012 17:23:06 -0700 (PDT) Original-Received: by 10.180.79.135 with SMTP id j7mr1625596wix.19.1334103786171; Tue, 10 Apr 2012 17:23:06 -0700 (PDT) Original-Received: by 10.223.63.70 with HTTP; Tue, 10 Apr 2012 17:22:50 -0700 (PDT) In-Reply-To: <495248DFDEA08C469BBDED2D4AA6C61442552C@DAKIYA1.pegasus.local> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 46.51.181.120 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84415 Archived-At: --f46d04428ff444ae9b04bd5c3e06 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 10, 2012 at 5:06 PM, Doug Lewan wrote: > Daniel, > > This is probably not hard, but more information would be useful. > > . Are the .xsl and .php files similarly named? "bob.xsl" and "bob.php"? > I have a few .xsl files and all the define()'s go to the same .php file. . Do you already have a regular expression to find the strings? Maybe you > have a "good" sample of strings to look for. > Unfortunately I will have to look for the string manually > . Does the location of the DEFINE() in the PHP file matter? Could it be > replacing something else? (Or interfering with something else?) > We are creating a .php file that is basically only a lot of those defines, then we send it to the translators and we have one of those files for each language. > > ,Doug > Thank you very much for your attention. > > > > From: Daniel Sousa > Sent: Monday, 2012 April 09 05:38 > To: help-gnu-emacs@gnu.org > Subject: Help with emacs scripting > > I'm new to emacs and I have not used it much, but I think that it could > really help me on the task I'm currently doing. > > I need to change a web app to make it translatable. Now I have to change a > bunch of .xsl files. What I need to do is find the strings, then replace > them by something like and add to a > .php something like DEFINE("_LANG_FOO","bar"); > > I think it would be really easy to create an emacs script to automatically > do this, but I don't know how to do it. Can anyone help me? > > Best regards, > Daniel Sousa > --f46d04428ff444ae9b04bd5c3e06 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Apr 10, 2012 at 5:06 PM, Doug Le= wan <dou= gl@shubertticketing.com> wrote:
Daniel,

This is probably not hard, but more information would be useful.

. Are the .xsl and .php files similarly named? "bob.xsl" and &quo= t;bob.php"?
I have a few .xsl files and all the d= efine()'s go to the same .php file.

. Do you already have a regular expression to find the strings? Maybe you h= ave a "good" sample of strings to look for.
= Unfortunately I will have to look for the string manually
=A0
. Does the location of the DEFINE() in the PHP file matter? Could it be rep= lacing something else? (Or interfering with something else?)
We are creating a .php file that is basically only a lot of those de= fines, then we send it to the translators and we have one of those files fo= r each language.
=A0

,Doug

Thank you very much for your atte= ntion.
=A0



From: Daniel Sousa
Sent: Monday, 2012 April 09 05:38
To: help-gnu-emacs@gnu.org Subject: Help with emacs scripting

I'm new to emacs and I have not used it much, but I think that it could= really help me on the task I'm currently doing.

I need to change a web app to make it translatable. Now I have to change a = bunch of .xsl files. What I need to do is find the strings, then replace th= em by something like=A0<xsl:value-of select=3D"/xml/lang/foo" = /> and add to a .php something like=A0DEFINE("_LANG_FOO","= ;bar");

I think it would be really easy to create an emacs script to automatically = do this, but I don't know how to do it. Can anyone help me?

Best regards,
Daniel Sousa

--f46d04428ff444ae9b04bd5c3e06--