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: Thu, 12 Apr 2012 17:10:11 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec53f346112554f04bd7d9856 X-Trace: dough.gmane.org 1334247055 2085 80.91.229.3 (12 Apr 2012 16:10:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2012 16:10:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 12 18:10:55 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 1SIMbl-00065f-QW for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 18:10:54 +0200 Original-Received: from localhost ([::1]:35346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIMbl-0007LI-0r for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 12:10:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIMbU-0006y2-DX for help-gnu-emacs@gnu.org; Thu, 12 Apr 2012 12:10:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIMbP-0005VP-4E for help-gnu-emacs@gnu.org; Thu, 12 Apr 2012 12:10:35 -0400 Original-Received: from sousa.cc ([46.51.181.120]:38173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIMbO-0005V5-QE for help-gnu-emacs@gnu.org; Thu, 12 Apr 2012 12:10:31 -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 4B17920478 for ; Thu, 12 Apr 2012 16:10:28 +0000 (UTC) Original-Received: by wgbdr1 with SMTP id dr1so1576349wgb.30 for ; Thu, 12 Apr 2012 09:10:27 -0700 (PDT) Original-Received: by 10.180.20.47 with SMTP id k15mr7249462wie.19.1334247026742; Thu, 12 Apr 2012 09:10:26 -0700 (PDT) Original-Received: by 10.223.63.70 with HTTP; Thu, 12 Apr 2012 09:10:11 -0700 (PDT) In-Reply-To: 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:84441 Archived-At: --bcaec53f346112554f04bd7d9856 Content-Type: text/plain; charset=ISO-8859-1 I'm majoring in applied math and computation, I know pretty well that computers are dumb xD I think neither of you have understood what I wanted, so I'll give you an example. I have a lot of .xsl that generate pages and I want to make those pages translatable. I migth have the file, for exemple, welcome.xsl:

Bem-vindo

  • Coisa
And I wanted to make this translatable, so I change this to

And I create a languages/pt.php with: define('_LANG_WELCOME','Bem-vindo'); define('_LANG_STUFF','Coisa'); I have a piece of php code that puts in the xml all the constants that begin with "_LANG". I have a lot of these .xsl and I need to go manually through them all to find the strings that I want to make translatable. What I want this script to do is, on my input put that thing on the place I select and append to the language file the repective define();. --bcaec53f346112554f04bd7d9856 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm majoring in applied math and computation, I know pretty well t= hat computers are dumb xD

I think neither of you have u= nderstood what I wanted, so I'll give you an example.
I have a lot = of .xsl that generate pages and I want to make those pages translatable. I = migth have the file, for exemple, welcome.xsl:
<?xml version=3D&= quot;1.0" encoding=3D"ISO-8859-1" ?>
<xsl:stylesheet version=3D"1.0&q= uot; xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform">=A0
<xsl:output method=3D&= quot;html" indent=3D"yes" encoding=3D"iso-8859-1" = />
<xsl:template match=3D= "/">
&l= t;xsl:if test=3D"welcome">
<p>Bem-vindo</p&= gt;
</xsl:if><= /div>
<ul>
<xsl:for-each select=3D"el= ements">
<= ;li>Coisa <xsl:value-of select=3D"name" /></li>
</xsl:for-each>
</ul>
<= span style=3D"white-space:pre-wrap"> </xsl:template>
</xsl:stylesheet>
And = I wanted to make this translatable, so I change this to
<?xml version=3D&= quot;1.0" encoding=3D"ISO-8859-1" ?>
<xsl:stylesheet version=3D"1.0&q= uot; xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform">=A0
<xsl:output method=3D&= quot;html" indent=3D"yes" encoding=3D"iso-8859-1" = />
<xsl:template match=3D= "/xml">
<xsl:if test=3D"welcome">
<p><xsl:value-of= select=3D"/xml/lang/_WELCOME" /></p>
</xsl:if>
<ul>
<xsl:for-each select=3D"elements">
<li> <xsl:value-of select=3D"/xml/lang/_STUFF" />=A0=A0<xsl:v= alue-of select=3D"name" /></li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
And I create a languages/pt.php with:
=A0define('_LANG_WELCOME','Bem-vind= o');
=A0define('_LANG_STUFF= ','Coisa');

I have a piece of php code that = puts in the xml all the constants that begin with "_LANG".

I have a lot of these .xsl and I need to go manually through the= m all to find the strings that I want to make translatable. What I want thi= s script to do is, on my input put that=A0<xsl:value-of select=3D"/= xml/lang/_STUFF" />=A0thing on the place I select and append to the= language file the repective define();.
--bcaec53f346112554f04bd7d9856--