Commit e59d9cd8 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

use g_utf8_strlen().

2005-11-02  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppropwidgets.c: use g_utf8_strlen().

	* plug-ins/uri/uri-backend-wget.c: use ngettext().
parent da5426cc
2005-11-02 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppropwidgets.c: use g_utf8_strlen().
* plug-ins/uri/uri-backend-wget.c: use ngettext().
2005-11-02 Michael Natterer <mitch@gimp.org>
* libgimp/gimpprocbrowserdialog.c
......@@ -16,7 +22,7 @@
2005-11-02 Sven Neumann <sven@gimp.org>
* libgimp/gimpprocbrowserdialog.c
* libgimpwidgets/gimppropwidgets.c
* plug-ins/uri/uri-backend-wget.c: added translator comments for
plural forms (bug #320461 and bug #320462).
......
......@@ -1788,7 +1788,7 @@ static void gimp_prop_text_buffer_notify (GObject *config,
* gimp_prop_text_buffer_new:
* @config: Object to which property is attached.
* @property_name: Name of string property.
* @max_len: Maximum allowed length of text.
* @max_len: Maximum allowed length of text (in characters).
*
* Creates a #GtkTextBuffer to set and display the value of the
* specified string property. Unless the string is expected to
......@@ -1796,6 +1796,9 @@ static void gimp_prop_text_buffer_notify (GObject *config,
* gimp_prop_entry_new() instead. See #GtkTextView for information on
* how to insert a text buffer into a visible widget.
*
* If @max_len is 0 or negative, the text buffer allows an unlimited
* number of characters to be entered.
*
* Return value: A new #GtkTextBuffer.
*
* Since GIMP 2.4
......@@ -1863,18 +1866,18 @@ gimp_prop_text_buffer_callback (GtkTextBuffer *text_buffer,
max_len = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (text_buffer),
"max-length"));
if (max_len > 0 && strlen (text) > max_len)
if (max_len > 0 && g_utf8_strlen (text, -1) > max_len)
{
g_message (dngettext (GETTEXT_PACKAGE "-libgimp",
"This text input field is limited to %d character.",
"This text input field is limited to %d characters.",
max_len), max_len);
gtk_text_buffer_get_iter_at_offset (text_buffer, &start_iter,
max_len - 1);
gtk_text_buffer_get_iter_at_offset (text_buffer,
&start_iter, max_len - 1);
gtk_text_buffer_get_end_iter (text_buffer, &end_iter);
/* this calls us recursivaly, but in the else branch */
/* this calls us recursively, but in the else branch */
gtk_text_buffer_delete (text_buffer, &start_iter, &end_iter);
}
else
......
......@@ -171,11 +171,9 @@ uri_backend_load_image (const gchar *uri,
/* The third line is "Connecting to..." */
/* translate with the appropriate plural form for many seconds */
timeout_msg = g_strdup_printf (dngettext (GETTEXT_PACKAGE "-std-plug-ins",
"(timeout is %d second)",
"(timeout is %d seconds)",
TIMEOUT), TIMEOUT);
timeout_msg = g_strdup_printf (ngettext ("(timeout is %s second)",
"(timeout is %s seconds)",
TIMEOUT), TIMEOUT);
gimp_progress_init_printf ("%s %s",
_("Connecting to server"), timeout_msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment