Re: message formatting and i18n

2005-02-07 Thread Andrew V. Samoilov
Hi Roland,
 
 some messages in the Midnight Commander don't translate well to other 
 languages because the string is concatenated manually, like in 
 src/ext.c, line 486.
 
 I started to fix some of these in mcedit. How do you feel about the new 
 code?

Well, it is step in right direction, but I am wondering why message() are not 
used?

-- 
Regards,
Andrew V. Samoilov


GET INTERNET ACCESS FROM BCS! http://www.bcs.zp.ua
Join BCS today! For your FREE webmail, visit: http://email.zp.ua/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: message formatting and i18n

2005-02-07 Thread Andrew V. Samoilov
Hello, Roland!

This patch fixes too many arguments for format warning and eliminates
g_string_*() at all.

-- 
Regards,
Andrew V. Samoilov


GET INTERNET ACCESS FROM BCS! http://www.bcs.zp.ua
Join BCS today! For your FREE webmail, visit: http://email.zp.ua/
src/ChangeLog:

* ext.c (regex_command): Eliminate g_string_*().

--- ext.c~  Mon Feb  7 09:29:42 2005
+++ ext.c   Mon Feb  7 15:50:27 2005
@@ -461,35 +461,27 @@ regex_command (const char *filename, con
home_error = 1;
goto check_stock_mc_ext;
} else {
-   GString *msg1 = g_string_new (NULL);
-   GString *msg2 = g_string_new (NULL);
-
-   g_string_sprintf (msg1, _( %s%s file error),
-   mc_home, MC_LIB_EXT);
-   g_string_sprintf (msg2, _(The format of the %smc.ext 
+   char *title =
+   g_strdup_printf (_( %s%s file error),
+   mc_home, MC_LIB_EXT);
+   message (1, title, _(The format of the %smc.ext 
file has changed with version 3.0.  It seems that 
the installation failed.  Please fetch a fresh 
copy from the Midnight Commander package.),
mc_home);
-   message (1, msg1-str, %s, msg2-str);
-   g_string_free (msg1, TRUE);
-   g_string_free (msg2, TRUE);
+   g_free (title);
return 0;
}
}
}
if (home_error) {
-   GString *title = g_string_new (NULL);
-   GString *text = g_string_new (NULL);
-
-   g_string_sprintf (title, _( ~/%s file error ), MC_USER_EXT);
-   g_string_sprintf (text, _(The format of the ~/%s file has 
+   char *title =
+   g_strdup_printf (_( ~/%s file error ), MC_USER_EXT);
+   message (1, title, _(The format of the ~/%s file has 
changed with version 3.0.  You may either want to copy 
it from %smc.ext of use that file as an example of how 
-   to write it.), MC_USER_EXT, mc_home, mc_home);
-   message (1, title-str, %s, text-str);
-   g_string_free (title, TRUE);
-   g_string_free (text, TRUE);
+   to write it.), MC_USER_EXT, mc_home);
+   g_free (title);
}
 }
 mc_stat (filename, mystat);
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: message formatting and i18n

2005-02-06 Thread Oswald Buddenhagen
On Sun, Feb 06, 2005 at 04:18:51PM +0100, Roland Illig wrote:
 + g_string_sprintf (errmsg, _( Cannot open pip for reading: %s ), 
 p);

somehow pip looks wrong to me. :)

 -catstrs (_( Not an ordinary file: ), filename,
 + _( %s is not an ordinary file ), filename);
  
i'm wondering why on earth ordinary was used, when the proper
terminology is regular and in no way less (i mean, even less :))
obvious to the uninitiated.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: message formatting and i18n

2005-02-06 Thread Roland Illig
Oswald Buddenhagen wrote:
On Sun, Feb 06, 2005 at 04:18:51PM +0100, Roland Illig wrote:
+   g_string_sprintf (errmsg, _( Cannot open pip for reading: %s ), 
p);
somehow pip looks wrong to me. :)

-  catstrs (_( Not an ordinary file: ), filename,
+   _( %s is not an ordinary file ), filename);
i'm wondering why on earth ordinary was used, when the proper
terminology is regular and in no way less (i mean, even less :))
obvious to the uninitiated.
Fixed the spelling errors and committed the rest.
Roland
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel