rpms/libtranslate/F-13 libtranslate-0.99-strip_tags.patch, NONE, 1.1 libtranslate-services.xml-20100303, NONE, 1.1 libtranslate.spec, 1.28, 1.29 libtranslate-services.xml.in-20090826, 1.1, NONE

Dmitry Butskoy buc at fedoraproject.org
Thu Mar 4 13:36:07 UTC 2010


Author: buc

Update of /cvs/extras/rpms/libtranslate/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4460

Modified Files:
	libtranslate.spec 
Added Files:
	libtranslate-0.99-strip_tags.patch 
	libtranslate-services.xml-20100303 
Removed Files:
	libtranslate-services.xml.in-20090826 
Log Message:
update services
strip static library


libtranslate-0.99-strip_tags.patch:
 translate-generic-service.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

--- NEW FILE libtranslate-0.99-strip_tags.patch ---
diff -Nrbu libtranslate-0.99/src/modules/translate-generic-service.c libtranslate-0.99-OK/src/modules/translate-generic-service.c
--- libtranslate-0.99/src/modules/translate-generic-service.c	2010-03-01 17:36:10.000000000 +0300
+++ libtranslate-0.99-OK/src/modules/translate-generic-service.c	2010-03-01 17:34:38.000000000 +0300
@@ -1030,6 +1030,45 @@
 	      const char *s;
 	      int len;
 
+
+	      /*  Some services return text with html tags inserted...  */
+	      if (strchr (raw, '<') != NULL) {
+		GError *error = NULL;
+		GRegex *regex;
+		gchar *new;
+
+		/*  Change any <br> to the ordinary newlines   */
+		regex = g_regex_new("</?br>", G_REGEX_CASELESS, 0, &error);
+		if (regex) {
+		  new = g_regex_replace_literal(regex, raw, -1, 0, "\n", 0, &error);
+		  if (new) {
+		    g_free (raw);
+		    raw = new;
+		  }
+		  g_regex_unref(regex);
+		}
+		if (error) {
+		  g_error_free(error);
+		  error = NULL;
+		}
+
+
+		/*  Remove any other html tags   */
+		regex = g_regex_new("<[^<>]+>", 0, 0, &error);
+		if (regex) {
+		  new = g_regex_replace_literal(regex, raw, -1, 0, "", 0, &error);
+		  if (new) {
+		    g_free (raw);
+		    raw = new;
+		  }
+		  g_regex_unref(regex);
+		}
+		if (error) {
+		  g_error_free(error);
+		  error = NULL;
+		}
+	      }
+
 	      expanded = translate_sgml_ref_expand(raw);
 	      g_free(raw);
 


--- NEW FILE libtranslate-services.xml-20100303 ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE services SYSTEM "services.dtd">
<services>
  <custom-language tag="oc_aran" name="Aranese"></custom-language>
  <custom-language tag="pt-BR" name="Portuguese (Brazil)"></custom-language>
  <custom-language tag="zh-TW" name="Chinese (Taiwan)"></custom-language>
  
  <service nick="Babel Fish" name="babelfish">
    <group>
      <language to="en,zh-TW" tag="zh"/>
      <language to="en,zh" tag="zh-TW" service-tag="zt"/>
      <language to="*" tag="en"/>
      <language to="en,fr" tag="nl"/>
      <language to="en,de,el,it,pt,nl,es" tag="fr"/>
      <language to="en,fr" tag="de"/>
      <language to="en,fr" tag="el"/>
      <language to="en,fr" tag="it"/>
      <language to="en" tag="ja"/>
      <language to="en" tag="ko"/>
      <language to="en,fr" tag="pt"/>
      <language to="en" tag="ru"/>
      <language to="en,fr" tag="es"/>
      <text-translation url="http://babelfish.yahoo.com/translate_txt?trtext=${text:escape}&amp;lp=${from}_${to}&amp;doit=done&amp;intl=1&amp;tt=urltext&amp;ei=utf8">
	<pre-marker text="&lt;div id=&quot;result&quot;&gt;"/>
	<pre-marker text="&gt;"/>
	<post-marker text="&lt;/div&gt;"/>
      </text-translation>
      <web-page-translation url="http://babelfish.yahoo.com/translate_url?trurl=${url:escape}&amp;lp=${from}_${to}&amp;doit=done&amp;intl=1&amp;tt=url&amp;ei=utf8"/>
    </group>
  </service>

  <service nick="SYSTRAN" name="systran">
    <group>
      <language to="en" tag="ar"/>
      <language to="en" tag="zh"/>
      <language to="en,fr" tag="nl"/>
      <language to="*" tag="en"/>
      <language to="nl,el,en,de,it,pt,es" tag="fr"/>
      <language to="en,es,fr,it,pt" tag="de"/>
      <language to="en,es,de,fr,pt" tag="it"/>
      <language to="en" tag="ja"/>
      <language to="en" tag="ko"/>
      <language to="en,es,de,fr,it" tag="pt"/>
      <language to="en" tag="ru"/>
      <language to="en,fr" tag="el"/>
      <language to="en,de,fr,it,pt" tag="es"/>
      <language to="en" tag="pl"/>
      <language to="en" tag="sv"/>
      <text-translation url="http://www.systranet.com/sai?gui=sbox/normal/systran/sboxEN&amp;lp=${from}_${to}&amp;service=translate" post="${text}">
	<pre-marker text="body=&#10;"/>
      </text-translation>
      <web-page-translation url="http://sysurl.systranet.com/?trans=1&amp;gui=sbox/normal/systran/systranEN&amp;lp=${from}_${to}&amp;loc_lang=en&amp;path=systran/systranEN&amp;frame=1&amp;url=${url:escape}"/>
    </group>
  </service>

  <service nick="Google" name="google">
    <group>
      <language to="*" tag="af"/>
      <language to="*" tag="ar"/>
      <language to="*" tag="bg"/>
      <language to="*" tag="be"/>
      <language to="*" tag="ca"/>
      <language to="*" tag="cs"/>
      <language to="*" tag="cy"/>
      <language to="*" tag="da"/>
      <language to="*" tag="de"/>
      <language to="*" tag="el"/>
      <language to="*" tag="en"/>
      <language to="*" tag="es"/>
      <language to="*" tag="et"/>
      <language to="*" tag="fa"/>
      <language to="*" tag="fi"/>
      <language to="*" tag="fil"/>
      <language to="*" tag="fr"/>
      <language to="*" tag="ga"/>
      <language to="*" tag="gl"/>
      <language to="*" tag="he"/>
      <language to="*" tag="hi"/>
      <language to="*" tag="hr"/>
      <language to="*" tag="hu"/>
      <language to="*" tag="id"/>
      <language to="*" tag="is"/>
      <language to="*" tag="it"/>
      <language to="*" tag="ja"/>
      <language to="*" tag="ko"/>
      <language to="*" tag="lt"/>
      <language to="*" tag="lv"/>
      <language to="*" tag="mk"/>
      <language to="*" tag="ms"/>
      <language to="*" tag="mt"/>
      <language to="*" tag="nl"/>
      <language to="*" tag="nb" service-tag="no"/> 
      <language to="*" tag="nn" service-tag="no"/> 
      <language to="*" tag="pl"/>
      <language to="*" tag="pt"/>
      <language to="*" tag="ro"/>
      <language to="*" tag="ru"/>
      <language to="*" tag="sk"/>
      <language to="*" tag="sl"/>
      <language to="*" tag="sq"/>
      <language to="*" tag="sr"/>
      <language to="*" tag="sv"/>
      <language to="*" tag="sw"/>
      <language to="*" tag="th"/>
      <language to="*" tag="tl"/>
      <language to="*" tag="tr"/>
      <language to="*" tag="uk"/>
      <language to="*" tag="vi"/>
      <language to="*" tag="yi"/>
      <language to="*" tag="zh" service-tag="zh-CN"/>
      <language to="*" tag="zh-TW"/>
      <text-translation url="http://www.google.com/translate_t?text=${text:escape}&amp;langpair=${from}|${to}&amp;ie=utf8&amp;oe=utf8">
	<pre-marker text="&lt;span title="/>
	<pre-marker text="&gt;"/>
	<post-marker text="&lt;/div&gt;"/>
      </text-translation>
      <web-page-translation url="http://translate.google.com/translate?u=${url:escape}&amp;sl=${from}&amp;tl=${to}"/>
    </group>
  </service>

  <service nick="FreeTranslation" name="freetranslation" max-chunk-len="600">
    <group>
      <language to="en" tag="nl" service-tag="dutch"/>
      <language to="da,nl,fi,fr,de,it,no,pt,es,sv" tag="en" service-tag="english"/>
      <language to="en" tag="fr" service-tag="french"/>
      <language to="en" tag="de" service-tag="german"/>
      <language to="en" tag="it" service-tag="italian"/>
      <language to="en" tag="pt" service-tag="portuguese"/>
      <language to="en" tag="es" service-tag="spanish"/>
      <text-translation url="http://ets.freetranslation.com/?sequence=core&amp;srctext=${text:escape}&amp;language=${from}/${to}&amp;charset=utf-8"/>
      <web-page-translation url="http://fets5.freetranslation.com/?sequence=core&amp;url=${url:escape}&amp;language=${from}/${to}"/>
    </group>
    <group>
      <language to="ru,zh,zh-TW" tag="en" service-tag="english"/>
      <language to="en" tag="ru" service-tag="russian"/>
      <text-translation url="http://ets6.freetranslation.com/?sequence=core&amp;srctext=${text:escape}&amp;language=${from}/${to}&amp;charset=utf-8"/>
    </group>
    <group>
      <language to="*" tag="en" service-tag="english"/>
      <language to="en" tag="ja" service-tag="japanese"/>
      <text-translation url="http://tets9.freetranslation.com/?sequence=core&amp;srctext=${text:escape}&amp;language=${from}/${to}&amp;charset=utf-8"/>
    </group>
    <group>
      <language to="de,es,ru" tag="fr" service-tag="french"/>
      <language to="fr,ru" tag="de" service-tag="german"/>
      <language to="ru" tag="it" service-tag="italian"/>
      <language to="de,fr,es" tag="ru" service-tag="russian"/>
      <language to="fr,ru" tag="es" service-tag="spanish"/>
      <text-translation url="http://sets8.freetranslation.com/?sequence=core&amp;username=newlang&amp;password=Not_lw!&amp;srctext=${text:escape}&amp;language=${from}/${to}&amp;charset=utf-8"/>
    </group>
  </service>

  <service nick="Kataku" name="kataku">
    <group>
      <language to="*" tag="en"/>
      <language to="*" tag="id" service-tag="in"/>
      <language to="tl" tag="en"/>
      <text-translation url="http://www.toggletext.com/main.cgi?page=translation" post="ttype=text&amp;input_text=${text:charset=ISO8859-1,escape}&amp;langset_text=${from}_${to}&amp;sms_option=">
	<pre-marker text="&lt;div id=&quot;trans_output&quot;&gt;"/>
	<pre-marker text="&lt;p class=&quot;output_text&quot;&gt;"/>
	<post-marker text="&#10;&lt;/p&gt;"/>
      </text-translation>
      <web-page-translation url="http://www.toggletext.com/kataku.cgi?translate=web&amp;frameset=1&amp;input_url=${url:escape}&amp;langset_text=${from}_${to}"/>
    </group>
  </service>

  <service nick="Papiamentu" name="papiamentu">
    <group>
      <language to="*" tag="en" service-tag="E"/>
      <language to="*" tag="pap" service-tag="P"/>
      <text-translation url="http://www.donamaro.nl/papiamentu/index.php?pAction=tradusi&amp;pSel=${from}2${to}&amp;pFrom=${text:charset=ISO8859-1,escape}">
	<pre-marker text="&lt;textarea name=&quot;pTo&quot;"/>
	<pre-marker text="&gt;"/>
	<post-marker text="&lt;/textarea&gt;"/>
      </text-translation>
    </group>
  </service>

  <service nick="Apertium" name="apertium">
    <group>
      <language to="en,es,eo,fr,oc,oc_aran" tag="ca"/>
      <language to="en" tag="cy"/>
      <language to="ca,es,gl" tag="en"/>
      <language to="ca,en,eo,fr,gl,pt,pt-BR" tag="es"/>
      <language to="es" tag="eu"/>
      <language to="ca,es" tag="fr"/>
      <language to="en,es" tag="gl"/>
      <language to="es" tag="pt"/>
      <language tag="pt-BR" service-tag="pt_BR"/>
      <language to="ca" tag="oc"/>
      <language to="es" tag="ro"/>
      <text-translation url="http://xixona.dlsi.ua.es/webservice/ws.php?text=${text:escape}&amp;mode=${from}-${to}"/>
      <web-page-translation url="http://www.apertium.org/apertium/tradurl.php?marcar=&amp;direccion=${from}-${to}&amp;inurl=${url:escape}"/>
    </group>
  </service>
  
  <service nick="Opentrad" name="opentrad">
    <group>
      <language to="en,es" tag="ca"/>
      <language to="ca,en,eu,fr,gl,pt" tag="es"/>
      <language to="en,es,pt" tag="gl"/>
      <language to="ca,es,gl" tag="en"/>
      <language to="es,gl" tag="pt"/>
      <language to="es" tag="fr"/>
      <text-translation url="http://opentrad.org/en/opentrad/traducir" post="direccion=${from}-${to}&amp;marcar=0&amp;cuadrotexto=${text:escape}">
	<post-marker text="&lt;script"/>
      </text-translation>
    </group>
  </service>
</services>


Index: libtranslate.spec
===================================================================
RCS file: /cvs/extras/rpms/libtranslate/F-13/libtranslate.spec,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -r1.28 -r1.29
--- libtranslate.spec	26 Aug 2009 12:23:39 -0000	1.28
+++ libtranslate.spec	4 Mar 2010 13:36:07 -0000	1.29
@@ -1,24 +1,26 @@
-Name: libtranslate
 Summary: Natural language translation library
+Name: libtranslate
 Version: 0.99
-Release: 22%{?dist}
-License: BSD
+Release: 23%{?dist}
 Group: System Environment/Libraries
+License: BSD
+URL: http://www.nongnu.org/libtranslate
 %define url	http://savannah.nongnu.org/download/libtranslate
 Source0: %{url}/libtranslate-%{version}.tar.gz
-Source1: libtranslate-services.xml.in-20090826
+Source1: libtranslate-services.xml-20100303
 Patch1: %{url}/libtranslate-0.99-charsetparse.diff
 Patch2: %{url}/libtranslate-0.99-condfix.diff
 Patch3: %{url}/libtranslate-0.99-int64.diff
 Patch4: %{url}/libtranslate-0.99-postmarker.diff
 Patch10: libtranslate-0.99-libsoup24.diff
 Patch11: libtranslate-0.99-fix-modules.patch
+Patch12: libtranslate-0.99-strip_tags.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: pkgconfig >= 1:0.8, gettext, intltool, libtool
 BuildRequires: glib2-devel, libsoup-devel >= 2.2, libxml2-devel
 BuildRequires: gnutls-devel, libgcrypt-devel
 Requires: libsoup >= 2.2
-URL: http://www.nongnu.org/libtranslate
 
 
 %description 
@@ -54,8 +56,7 @@ The static libraries and header files fo
 %patch4 -p1
 %patch10 -p1
 %patch11 -p1
-
-cp -p %{SOURCE1} data/services.xml.in
+%patch12 -p1
 
 libtoolize --force
 intltoolize --automake --force
@@ -65,7 +66,7 @@ autoconf
 
 
 %build
-%configure
+%configure --disable-static
 make
 
 pushd docs/man
@@ -83,8 +84,11 @@ pushd $RPM_BUILD_ROOT%{_mandir}/man5
 mv -f services.xml.5 libtranslate.5
 popd
 
+rm -f $RPM_BUILD_ROOT%{_datadir}/libtranslate/services.xml
+install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/libtranslate/services.xml
+
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libtranslate/modules/*.{la,a}
+rm -f $RPM_BUILD_ROOT%{_libdir}/libtranslate/modules/*.la
 
 %find_lang %{name}
 
@@ -114,16 +118,20 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-, root, root, -)
 
 %{_libdir}/libtranslate.so
-%{_libdir}/*.a
 %{_includedir}/libtranslate/
 %{_datadir}/gtk-doc/html/*
 %{_libdir}/pkgconfig/*
 
 
 %changelog
+* Mon Mar  3 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 0.99-23
+- handle tags inside the text properly (#541234)
+- remove static library (#556076)
+- update services.xml (by me and Dwayne Bailey <dwayne at translate.org.za>)
+
 * Wed Aug 26 2009 Dmitry Butskoy <Dmitry at Butskoy.name> - 0.99-22
 - add new language pairs for google service
-  (#519247, by Dwayne Bailey (dwayne at translate.org.za>)
+  (#519247, by Dwayne Bailey <dwayne at translate.org.za>)
 - use up-to-date services.xml.in plain file as an additional source,
   instead of a lot of patches for upstream's one
 


--- libtranslate-services.xml.in-20090826 DELETED ---



More information about the scm-commits mailing list