gtranslator r3664 - trunk/src



Author: icq
Date: Mon Sep 22 09:41:43 2008
New Revision: 3664
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3664&view=rev

Log:
	* po.c:
	(gtranslator_po_save_header_in_msg):
	Checking if the comments are in utf8.

Modified:
   trunk/src/ChangeLog
   trunk/src/po.c

Modified: trunk/src/po.c
==============================================================================
--- trunk/src/po.c	(original)
+++ trunk/src/po.c	Mon Sep 22 09:41:43 2008
@@ -671,7 +671,6 @@
 	  }
 	  i++;
 	}
-	
 	aux = g_strconcat(gtranslator_header_get_translator(header), " ", "<",
 			  gtranslator_header_get_tr_email(header), ">", NULL);
 	
@@ -683,15 +682,11 @@
 	if (!strcmp (prev_translator, aux) && 
 	    (strcmp(comments_translator_values[g_strv_length (comments_translator_values)-1], comp_year))) {
 	  
-	  /*
-	   * Current translator is in the last line in comments.
-	   */
-	  if (j == g_strv_length (comments_lines)-1) {
-	    aux2 = g_strconcat (comments, ", ", year, ".", NULL);
-	    po_message_set_comments (message, aux2);
-	    g_free (aux2);
-	  }else {
+	    if (!g_utf8_validate (comments_lines[j], -1, NULL))
+	      g_utf8_normalize (comments_lines[j], -1, G_NORMALIZE_DEFAULT);
+
 	    line_without_dot = g_utf8_strncpy (line_without_dot, comments_lines[j], strlen(comments_lines[j])-1);
+	    
 	    line = g_strconcat (line_without_dot, ", ", year, ".", NULL);
 	   
 	    for (l=j; l<(g_strv_length (comments_lines)); l++) {
@@ -708,7 +703,6 @@
 	    g_free (line_without_dot);
 	    g_free (line);
 	    g_free (new_comments);
-	  }
 	}    
 
 	/*



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