[gimp] Bug 605540 - texts displayed with gimp-message are not translated



commit 77498d15875ba242cc720586e5a99e71521da328
Author: Kevin Cozens <kcozens cvs gnome org>
Date:   Thu Feb 11 12:02:57 2010 -0500

    Bug 605540 - texts displayed with gimp-message are not translated
    
    Applied modified version of patch supplied by Eric Lamarque.

 plug-ins/script-fu/tinyscheme/scheme.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c
index 2d0a032..5b0ae4d 100644
--- a/plug-ins/script-fu/tinyscheme/scheme.c
+++ b/plug-ins/script-fu/tinyscheme/scheme.c
@@ -48,6 +48,8 @@
 
 #include <libintl.h>
 
+#include "../script-fu-intl.h"
+
 #include "scheme-private.h"
 
 #if !STANDALONE
@@ -93,6 +95,7 @@ ts_output_string (TsOutputType  type,
 #define TOK_SHARP   10
 #define TOK_SHARP_CONST 11
 #define TOK_VEC     12
+#define TOK_USCORE  13
 
 # define BACKQUOTE '`'
 
@@ -1957,7 +1960,7 @@ static int token(scheme *sc) {
           return (TOK_DQUOTE);
      case '_':
           if ((c=inchar(sc)) == '"')
-               return (TOK_DQUOTE);
+               return (TOK_USCORE);
           backchar(sc,c);
           return (TOK_ATOM);
      case BACKQUOTE:
@@ -4058,6 +4061,7 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
 
 static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
      pointer x;
+     char *trans_str;
 
      if(sc->nesting!=0) {
           int n=sc->nesting;
@@ -4184,6 +4188,19 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
                }
                setimmutable(x);
                s_return(sc,x);
+          case TOK_USCORE:
+               x=readstrexp(sc);
+               if(x==sc->F) {
+                 Error_0(sc,"Error reading string");
+               }
+               trans_str = gettext (strvalue (x));
+               if (trans_str != strvalue(x)) {
+                 sc->free(strvalue(x));
+                 strlength(x) = g_utf8_strlen(trans_str, -1);
+                 strvalue(x) = store_string(sc, strlength(x), trans_str, 0);
+               }
+               setimmutable(x);
+               s_return(sc,x);
           case TOK_SHARP: {
                pointer f=find_slot_in_env(sc,sc->envir,sc->SHARP_HOOK,1);
                if(f==sc->NIL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]