@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009, 2010
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
-@page
@node Internationalization
@section Support for Internationalization
(use-modules (ice-9 i18n))
@end example
-@cindex libguile-i18n-v-@value{LIBGUILE_I18N_MAJOR}
-
-C programs can use the C functions corresponding to the procedures of
-this module by including @code{<libguile/i18n.h>} and by linking
-against @code{libguile-i18n-v-@value{LIBGUILE_I18N_MAJOR}}.
-
@cindex cultural conventions
The @code{(ice-9 i18n)} module provides procedures to manipulate text
to either @var{locale} or the current locale.
@end deffn
+@deffn {Scheme Procedure} char-locale-titlecase chr [locale]
+@deffnx {C Function} scm_char_locale_titlecase (chr, locale)
+Return the titlecase character that corresponds to @var{chr} according
+to either @var{locale} or the current locale.
+@end deffn
+
@deffn {Scheme Procedure} string-locale-upcase str [locale]
@deffnx {C Function} scm_string_locale_upcase (str, locale)
Return a new string that is the uppercase version of @var{str}
according to either @var{locale} or the current locale.
@end deffn
-Note that in the current implementation Guile has no notion of
-multibyte characters and in a multibyte locale characters may not be
-converted correctly.
+@deffn {Scheme Procedure} string-locale-titlecase str [locale]
+@deffnx {C Function} scm_string_locale_titlecase (str, locale)
+Return a new string that is the titlecase version of @var{str}
+according to either @var{locale} or the current locale.
+@end deffn
@node Number Input and Output, Accessing Locale Information, Character Case Mapping, Internationalization
@subsection Number Input and Output
Here is an example:
@example
+(use-modules (ice-9 rdelim))
(format #t "Does Guile rock?~%")
-(let ((answer (read-line)))
+(let lp ((answer (read-line)))
(cond ((string-match (locale-yes-regexp) answer)
- "Yes it does.")
+ (format #t "High fives!~%"))
((string-match (locale-no-regexp) answer)
- "No it doesn't.")
+ (format #t "How about now? Does it rock yet?~%")
+ (lp (read-line)))
(else
- "What do you mean?")))
+ (format #t "What do you mean?~%")
+ (lp (read-line)))))
@end example
For an internationalized yes/no string output, @code{gettext} should
Example uses of some of these functions are the implementation of the
@code{number->locale-string} and @code{monetary-amount->locale-string}
procedures (@pxref{Number Input and Output}), as well as that the
-SRFI-19 date and time convertion to/from strings (@pxref{SRFI-19}).
+SRFI-19 date and time conversion to/from strings (@pxref{SRFI-19}).
@node Gettext Support, , Accessing Locale Information, Internationalization