aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-05 18:51:26 +0000
committerKalle Wallin <kaw@linux.se>2004-06-05 18:51:26 +0000
commit9b2d077c7f5dca6e4013f04318f7b83531fac387 (patch)
treefa6ea3f9e8ba86e744cfe53ea1a6d58a9e63ecf9
parent225e70a38b68cba219aeb7cb239f426ca739ed7d (diff)
downloadmpd-9b2d077c7f5dca6e4013f04318f7b83531fac387.tar.gz
mpd-9b2d077c7f5dca6e4013f04318f7b83531fac387.tar.xz
mpd-9b2d077c7f5dca6e4013f04318f7b83531fac387.zip
Added initial i18n support
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--COPYING340
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.am4
-rw-r--r--README2
-rw-r--r--configure.ac46
-rw-r--r--doc/ncmpc.12
-rw-r--r--m4/codeset.m423
-rw-r--r--m4/glib-gettext.m4380
-rw-r--r--m4/glibc21.m432
-rw-r--r--m4/iconv.m4103
-rw-r--r--m4/intdiv0.m472
-rw-r--r--m4/inttypes-pri.m432
-rw-r--r--m4/inttypes.m427
-rw-r--r--m4/inttypes_h.m428
-rw-r--r--m4/isc-posix.m426
-rw-r--r--m4/lcmessage.m432
-rw-r--r--m4/nls.m449
-rw-r--r--m4/pkg.m457
-rw-r--r--m4/po.m4197
-rw-r--r--m4/stdint_h.m428
-rw-r--r--m4/uintmax_t.m432
-rw-r--r--m4/ulonglong.m423
-rw-r--r--po/ChangeLog0
-rw-r--r--po/Makefile.in.in254
-rw-r--r--po/POTFILES.in12
-rw-r--r--po/ncmpc.pot543
-rw-r--r--po/sv.po545
-rw-r--r--src/Makefile.am7
-rw-r--r--src/colors.c9
-rw-r--r--src/command.c119
-rw-r--r--src/conf.c32
-rw-r--r--src/main.c25
-rw-r--r--src/screen.c69
-rw-r--r--src/screen.h6
-rw-r--r--src/screen_file.c20
-rw-r--r--src/screen_keydef.c38
-rw-r--r--src/screen_play.c18
-rw-r--r--src/screen_utils.c7
-rw-r--r--src/support.c11
39 files changed, 3050 insertions, 204 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 000000000..d60c31a97
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
index 2a4de6102..65701a93d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,13 @@
2004-06-05 Kalle Wallin <kaw@linux.se>
+ * Added initial i18n support
* Changed directory layout to suit future use of gettext
+ * Changed the default port to 6600
* screen.c: Added mpd update flag [U] and display a status message
when a update has finished
* screen.c: Display bit rate instead of time when the total time
is zero and display local time when mpd is stopped.
+ * Addded support for the mpd update command.
+
2004-05-07 Kalle Wallin <kaw@linux.se>
* Redesigned ncmpc's color support - view the manual for details!
diff --git a/Makefile.am b/Makefile.am
index 8bf3267ee..76bad72c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,11 +4,11 @@
AUTOMAKE_OPTIONS = foreign 1.6
-SUBDIRS = doc src
+SUBDIRS = src doc po
pkgdata_DATA =
docdir = $(prefix)/share/doc/$(PACKAGE)
doc_DATA = AUTHORS README
-EXTRA_DIST = ChangeLog COPYING $(pkgdata_DATA) $(doc_DATA)
+EXTRA_DIST = COPYING $(pkgdata_DATA) $(doc_DATA)
diff --git a/README b/README
index 91be96536..9a618c97f 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ ncmpc is a ncurses client for MPD, the Music Player Daemon with an
interface is inspired by cplay (by Ulf Betlehem).
The client connects to a MPD running on a machine on the local network.
-By default, ncmpc connects to localhost:2100. This can be
+By default, ncmpc connects to localhost:6600. This can be
changed either at compile-time, or by exporting the MPD_HOST and
MPD_PORT environment variables, or by the command line options --host
and --port.
diff --git a/configure.ac b/configure.ac
index d1601f9c8..20cc143af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ dnl
AC_INIT
AC_CONFIG_SRCDIR([src/main.c])
AM_INIT_AUTOMAKE(ncmpc, 0.11.0-svn)
+AM_CONFIG_HEADER([config.h])
dnl Check for programs
AC_PROG_CC
@@ -16,7 +17,6 @@ dnl initialize variables
dnl =======================================================
set -- $CFLAGS
-CFLAGS="-Wall $CFLAGS"
keydef_screen=yes
@@ -54,8 +54,33 @@ dnl ncurses
AC_CHECK_LIB(ncurses, initscr,, [AC_MSG_ERROR(ncurses library is required)])
LIBS="$LIBS -lncurses"
-dnl glib-2.0
-AM_PATH_GLIB_2_0(, , [AC_MSG_ERROR(glib-2.x is required)], glib)
+dnl Check for glib-2
+#AM_PATH_GLIB_2_0(, , [AC_MSG_ERROR(glib-2.x is required)], glib)
+PKG_CHECK_MODULES(GLIB,
+ glib-2.0 >= 2.2,
+ ,
+ AC_MSG_ERROR(glib-2.2 is required))
+
+dnl i18n
+ALL_LINGUAS=""
+AC_MSG_CHECKING([whether to include NLS support])
+AC_ARG_ENABLE([nls],
+ AC_HELP_STRING([--enable-nls],
+ [include natural language support @<:@default=yes@:>@]),
+ [nls="$enableval"],
+ [nls=yes])
+AC_MSG_RESULT([$nls])
+if test "x$nls" = "xyes"; then
+ ALL_LINGUAS="sv"
+ AM_GLIB_GNU_GETTEXT
+ GETTEXT_PACKAGE=$PACKAGE
+ AC_SUBST(GETTEXT_PACKAGE)
+ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
+ ["${GETTEXT_PACKAGE}"],
+ [gettext domain])
+ nls=$gt_cv_have_gettext
+fi
+
dnl popt
AC_CHECK_LIB(popt,
@@ -73,7 +98,7 @@ AC_ARG_ENABLE(debug,
enable_debug=no)
if test "$enable_debug" = yes; then
- CFLAGS="$CFLAGS -g -DDEBUG"
+ CFLAGS="$CFLAGS -Wall -g -DDEBUG"
fi
dnl Key editor
@@ -83,9 +108,9 @@ AC_ARG_ENABLE(key-editor,
keydef_screen=no,
keydef_screen=yes)
if test "$keydef_screen" = yes; then
- CFLAGS="$CFLAGS -DENABLE_KEYDEF_SCREEN"
+ AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable builtin key editor])
fi
-dnl AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable builtin key editor]),
+
dnl Default host
@@ -101,23 +126,18 @@ AC_ARG_WITH(default-port,
DEFAULT_PORT="6600")
-CFLAGS="$CFLAGS $GLIB_CFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
-LIBS="$LIBS $GLIB_LIBS"
-
-
dnl Autoheader
AC_DEFINE_UNQUOTED(DEFAULT_PORT, $DEFAULT_PORT, Default MPD port)
AC_DEFINE_UNQUOTED(DEFAULT_PORT_STR, "$DEFAULT_PORT", Default MPD port)
AC_DEFINE_UNQUOTED(DEFAULT_HOST, "$DEFAULT_HOST", Default MPD host)
-AM_CONFIG_HEADER(config.h)
-
-AC_CONFIG_FILES([doc/Makefile src/Makefile Makefile])
+AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
AC_OUTPUT
echo "
Configuration:
prefix: ${prefix}
+ nls: ${nls}
sysconfdir: ${sysconfdir}
Default MPD host: ${DEFAULT_HOST}
Default MPD port: ${DEFAULT_PORT}
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index 93d297ff5..bf471e755 100644
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
@@ -9,7 +9,7 @@ ncmpc is a client for MPD, the Music Player Daemon.
ncmpc connects to a MPD running on a machine on the local
network.
-By default, ncmpc connects to localhost:2100.
+By default, ncmpc connects to localhost:6600.
This can be changed either at compile\-time, or by exporting the
MPD_HOST and MPD_PORT environment variables, or by the command line
options \-\-host and \-\-port.
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 000000000..59535ebcf
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,23 @@
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/m4/glib-gettext.m4 b/m4/glib-gettext.m4
new file mode 100644
index 000000000..5a4ef2814
--- /dev/null
+++ b/m4/glib-gettext.m4
@@ -0,0 +1,380 @@
+# Copyright (C) 1995-2002 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003 Red Hat, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License. As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+#
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
+#
+# Modified to never use included libintl.
+# Owen Taylor <otaylor@redhat.com>, 12/15/1998
+#
+# Major rework to remove unused code
+# Owen Taylor <otaylor@redhat.com>, 12/11/2002
+#
+# Added better handling of ALL_LINGUAS from GNU gettext version
+# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
+
+#
+# We need this here as well, since someone might use autoconf-2.5x
+# to configure GLib then an older version to configure a package
+# using AM_GLIB_GNU_GETTEXT
+AC_PREREQ(2.53)
+
+dnl
+dnl We go to great lengths to make sure that aclocal won't
+dnl try to pull in the installed version of these macros
+dnl when running aclocal in the glib directory.
+dnl
+m4_copy([AC_DEFUN],[glib_DEFUN])
+m4_copy([AC_REQUIRE],[glib_REQUIRE])
+dnl
+dnl At the end, if we're not within glib, we'll define the public
+dnl definitions in terms of our private definitions.
+dnl
+
+# GLIB_LC_MESSAGES
+#--------------------
+glib_DEFUN([GLIB_LC_MESSAGES],
+ [AC_CHECK_HEADERS([locale.h])
+ if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+ fi])
+
+# GLIB_PATH_PROG_WITH_TEST
+#----------------------------
+dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# GLIB_WITH_NLS
+#-----------------
+glib_DEFUN([GLIB_WITH_NLS],
+ dnl NLS is obligatory
+ [USE_NLS=yes
+ AC_SUBST(USE_NLS)
+
+ gt_cv_have_gettext=no
+
+ CATOBJEXT=NONE
+ XGETTEXT=:
+ INTLLIBS=
+
+ AC_CHECK_HEADER(libintl.h,
+ [gt_cv_func_dgettext_libintl="no"
+ libintl_extra_libs=""
+
+ #
+ # First check in libc
+ #
+ AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
+ [AC_TRY_LINK([
+#include <libintl.h>
+],
+ [return (int) dgettext ("","")],
+ gt_cv_func_dgettext_libc=yes,
+ gt_cv_func_dgettext_libc=no)
+ ])
+
+ if test "$gt_cv_func_dgettext_libc" = "yes" ; then
+ AC_CHECK_FUNCS(bind_textdomain_codeset)
+ fi
+
+ #
+ # If we don't have everything we want, check in libintl
+ #
+ if test "$gt_cv_func_dgettext_libc" != "yes" \
+ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
+
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CHECK_LIB(intl, dgettext,
+ gt_cv_func_dgettext_libintl=yes)])
+
+ if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
+ AC_MSG_CHECKING([if -liconv is needed to use gettext])
+ AC_MSG_RESULT([])
+ AC_CHECK_LIB(intl, dcgettext,
+ [gt_cv_func_dgettext_libintl=yes
+ libintl_extra_libs=-liconv],
+ :,-liconv)
+ fi
+
+ #
+ # If we found libintl, then check in it for bind_textdomain_codeset();
+ # we'll prefer libc if neither have bind_textdomain_codeset(),
+ # and both have dgettext
+ #
+ if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
+ glib_save_LIBS="$LIBS"
+ LIBS="$LIBS -lintl $libintl_extra_libs"
+ unset ac_cv_func_bind_textdomain_codeset
+ AC_CHECK_FUNCS(bind_textdomain_codeset)
+ LIBS="$glib_save_LIBS"
+
+ if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
+ gt_cv_func_dgettext_libc=no
+ else
+ if test "$gt_cv_func_dgettext_libc" = "yes"; then
+ gt_cv_func_dgettext_libintl=no
+ fi
+ fi
+ fi
+ fi
+
+ if test "$gt_cv_func_dgettext_libc" = "yes" \
+ || test "$gt_cv_func_dgettext_libintl" = "yes"; then
+ gt_cv_have_gettext=yes
+ fi
+
+ if test "$gt_cv_func_dgettext_libintl" = "yes"; then
+ INTLLIBS="-lintl $libintl_extra_libs"
+ fi
+
+ if test "$gt_cv_have_gettext" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT,1,
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ glib_save_LIBS="$LIBS"
+ LIBS="$LIBS $INTLLIBS"
+ AC_CHECK_FUNCS(dcgettext)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [case $host in
+ *-*-solaris*)
+ dnl On Solaris, if bind_textdomain_codeset is in libc,
+ dnl GNU format message catalog is always supported,
+ dnl since both are added to the libc all together.
+ dnl Hence, we'd like to go with DATADIRNAME=share and
+ dnl and CATOBJEXT=.gmo in this case.
+ AC_CHECK_FUNC(bind_textdomain_codeset,
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ ;;
+ *)
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
+ ;;
+ esac])
+ LIBS="$glib_save_LIBS"
+ INSTOBJEXT=.mo
+ else
+ gt_cv_have_gettext=no
+ fi
+ fi
+ ])
+
+ if test "$gt_cv_have_gettext" = "yes" ; then
+ AC_DEFINE(ENABLE_NLS, 1,
+ [always defined to indicate that i18n is enabled])
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is not GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext program is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+
+ AC_OUTPUT_COMMANDS(
+ [case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac])
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(PO_IN_DATADIR_TRUE)
+ AC_SUBST(PO_IN_DATADIR_FALSE)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+# AM_GLIB_GNU_GETTEXT
+# -------------------
+# Do checks necessary for use of gettext. If a suitable implementation
+# of gettext is found in either in libintl or in the C library,
+# it will set INTLLIBS to the libraries needed for use of gettext
+# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
+# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
+# on various variables needed by the Makefile.in.in installed by
+# glib-gettextize.
+dnl
+glib_DEFUN([GLIB_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+
+ GLIB_LC_MESSAGES
+ GLIB_WITH_NLS
+
+ if test "$gt_cv_have_gettext" = "yes"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ NEW_LINGUAS="$NEW_LINGUAS $presentlang"
+ fi
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+ dnl Try to locate is.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl Generate list of files to be processed by xgettext which will
+ dnl be included in po/Makefile.
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ ])
+
+# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
+# -------------------------------
+# Define VARIABLE to the location where catalog files will
+# be installed by po/Makefile.
+glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
+[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
+glib_save_prefix="$prefix"
+glib_save_exec_prefix="$exec_prefix"
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+if test "x$CATOBJEXT" = "x.mo" ; then
+ localedir=`eval echo "${libdir}/locale"`
+else
+ localedir=`eval echo "${datadir}/locale"`
+fi
+prefix="$glib_save_prefix"
+exec_prefix="$glib_save_exec_prefix"
+AC_DEFINE_UNQUOTED($1, "$localedir",
+ [Define the location where the catalogs will be installed])
+])
+
+dnl
+dnl Now the definitions that aclocal will find
+dnl
+ifdef(glib_configure_in,[],[
+AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
+AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
+])dnl
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 000000000..9c9f3db30
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,0 +1,32 @@
+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([jm_GLIBC21],
+ [
+ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+ ac_cv_gnu_library_2_1,
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2_1=yes,
+ ac_cv_gnu_library_2_1=no)
+ ]
+ )
+ AC_SUBST(GLIBC21)
+ GLIBC21="$ac_cv_gnu_library_2_1"
+ ]
+)
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644
index 000000000..c5f357982
--- /dev/null
+++ b/m4/iconv.m4
@@ -0,0 +1,103 @@
+# iconv.m4 serial AM4 (gettext-0.11.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST(LIBICONV)
+ AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644
index 000000000..55dddcf1c
--- /dev/null
+++ b/m4/intdiv0.m4
@@ -0,0 +1,72 @@
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+ gt_cv_int_divbyzero_sigfpe,
+ [
+ AC_TRY_RUN([
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+#ifdef __cplusplus
+sigfpe_handler (int sig)
+#else
+sigfpe_handler (sig) int sig;
+#endif
+{
+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
+ exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+ signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+ signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL. */
+#if defined (__sparc__) && defined (__linux__)
+ signal (SIGILL, sigfpe_handler);
+#endif
+
+ z = x / y;
+ nan = y / y;
+ exit (1);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+ [
+ # Guess based on the CPU.
+ case "$host_cpu" in
+ alpha* | i[34567]86 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+ ])
+ ])
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+ [Define if integer division by zero raises signal SIGFPE.])
+])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 000000000..fd007c312
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,32 @@
+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ gt_cv_inttypes_pri_broken,
+ [
+ AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ fi
+])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 000000000..ab370ffe0
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,27 @@
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+ ])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 000000000..f342eba39
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,28 @@
+# inttypes_h.m4 serial 5 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_inttypes_h=yes,
+ jm_ac_cv_header_inttypes_h=no)])
+ if test $jm_ac_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
new file mode 100644
index 000000000..1319dd1c7
--- /dev/null
+++ b/m4/isc-posix.m4
@@ -0,0 +1,26 @@
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+ [
+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+ ]
+)
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
new file mode 100644
index 000000000..ffd4008b8
--- /dev/null
+++ b/m4/lcmessage.m4
@@ -0,0 +1,32 @@
+# lcmessage.m4 serial 3 (gettext-0.11.3)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([AM_LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
diff --git a/m4/nls.m4 b/m4/nls.m4
new file mode 100644
index 000000000..36bc49317
--- /dev/null
+++ b/m4/nls.m4
@@ -0,0 +1,49 @@
+# nls.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+])
+
+AC_DEFUN([AM_MKINSTALLDIRS],
+[
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
+ dnl Try to locate it.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ case "$ac_aux_dir" in
+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
+ esac
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+])
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644
index 000000000..c80e0acfc
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,57 @@
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
+
+
diff --git a/m4/po.m4 b/m4/po.m4
new file mode 100644
index 000000000..861e3dec3
--- /dev/null
+++ b/m4/po.m4
@@ -0,0 +1,197 @@
+# po.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
+
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+ dnl Test whether we really found GNU msgfmt.
+ if test "$GMSGFMT" != ":"; then
+ dnl If it is no GNU msgfmt we define it as : so that the
+ dnl Makefiles still can work.
+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
+ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
+ AC_MSG_RESULT(
+ [found $GMSGFMT program is not GNU msgfmt; ignore it])
+ GMSGFMT=":"
+ fi
+ fi
+
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext program is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+ fi
+
+ AC_OUTPUT_COMMANDS([
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ GMOFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
+ # from automake.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644
index 000000000..32ba7ae77
--- /dev/null
+++ b/m4/stdint_h.m4
@@ -0,0 +1,28 @@
+# stdint_h.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_stdint_h=yes,
+ jm_ac_cv_header_stdint_h=no)])
+ if test $jm_ac_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
new file mode 100644
index 000000000..b5f28d440
--- /dev/null
+++ b/m4/uintmax_t.m4
@@ -0,0 +1,32 @@
+# uintmax_t.m4 serial 7 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ [Define to unsigned long or unsigned long long
+ if <stdint.h> and <inttypes.h> don't define.])
+ else
+ AC_DEFINE(HAVE_UINTMAX_T, 1,
+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4
new file mode 100644
index 000000000..c375e474c
--- /dev/null
+++ b/m4/ulonglong.m4
@@ -0,0 +1,23 @@
+# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
+dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the unsigned long long type.])
+ fi
+])
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/po/ChangeLog
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 000000000..092b4e0dc
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,254 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+#
+# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
+# instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob@ximian.com> to install
+# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+libdir = @libdir@
+localedir = $(libdir)/locale
+gnulocaledir = $(datadir)/locale
+gettextsrcdir = $(datadir)/glib-2.0/gettext/po
+subdir = po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
+
+CC = @CC@
+GENCAT = @GENCAT@
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+MSGMERGE = msgmerge
+
+DEFS = @DEFS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
+INCLUDES = -I.. -I$(top_srcdir)/intl
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+SOURCES =
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
+$(POFILES) $(GMOFILES) $(SOURCES)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES:
+.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+
+.c.o:
+ $(COMPILE) $<
+
+.po.pox:
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && $(GENCAT) $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
+ --files-from=$(srcdir)/POTFILES.in \
+ && test ! -f $(GETTEXT_PACKAGE).po \
+ || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
+ && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
+ else \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
+ fi
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $$dir; \
+ else \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
+ fi; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m \
+ $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+ if test "$(PACKAGE)" = "glib"; then \
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
+ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+ done
+ if test "$(PACKAGE)" = "glib"; then \
+ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
+ fi
+
+check: all
+
+dvi info tags TAGS ID:
+
+mostlyclean:
+ rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f $(GMOFILES)
+
+distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: update-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ for file in $$dists; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ tmpdir=`pwd`; \
+ cd $(srcdir); \
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ echo "$$lang:"; \
+ if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$cat failed!"; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi; \
+ done
+
+# POTFILES is created from POTFILES.in by stripping comments, empty lines
+# and Intltool tags (enclosed in square brackets), and appending a full
+# relative path to them
+POTFILES: POTFILES.in
+ ( if test 'x$(srcdir)' != 'x.'; then \
+ posrcprefix='$(top_srcdir)/'; \
+ else \
+ posrcprefix="../"; \
+ fi; \
+ rm -f $@-t $@ \
+ && (sed -e '/^#/d' \
+ -e "s/^\[.*\] +//" \
+ -e '/^[ ]*$$/d' \
+ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+Makefile: Makefile.in.in ../config.status POTFILES
+ cd .. \
+ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 000000000..b72607941
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,12 @@
+# source files
+
+src/main.c
+src/screen.c
+src/screen_utils.c
+src/screen_play.c
+src/screen_file.c
+src/screen_keydef.c
+src/screen_help.c
+src/command.c
+src/colors.c
+src/support.c
diff --git a/po/ncmpc.pot b/po/ncmpc.pot
new file mode 100644
index 000000000..42c110607
--- /dev/null
+++ b/po/ncmpc.pot
@@ -0,0 +1,543 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-05 20:20+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:59
+msgid ""
+"\n"
+"Exiting...\n"
+msgstr ""
+
+#: src/main.c:89
+msgid "Confusing key bindings - exiting!\n"
+msgstr ""
+
+#: src/main.c:153
+#, c-format
+msgid "Lost connection to %s"
+msgstr ""
+
+#: src/main.c:183
+#, c-format
+msgid "Connecting to %s... [Press Ctrl-C to abort]"
+msgstr ""
+
+#: src/main.c:190
+#, c-format
+msgid "Connected to %s!"
+msgstr ""
+
+#: src/screen.c:131
+msgid ":Help "
+msgstr ""
+
+#: src/screen.c:135
+msgid ":Playlist "
+msgstr ""
+
+#: src/screen.c:139
+msgid ":Browse"
+msgstr ""
+
+#: src/screen.c:143
+msgid "Volume n/a "
+msgstr ""
+
+#: src/screen.c:147
+#, c-format
+msgid " Volume %d%%"
+msgstr ""
+
+#: src/screen.c:266
+msgid "Stopped! "
+msgstr ""
+
+#: src/screen.c:269
+msgid "Playing:"
+msgstr ""
+
+#: src/screen.c:272
+msgid "[Paused]"
+msgstr ""
+
+#: src/screen.c:382 src/screen.c:482
+msgid "Error: Screen to small!\n"
+msgstr ""
+
+#: src/screen.c:627
+msgid "Repeat is on"
+msgstr ""
+
+#: src/screen.c:628
+msgid "Repeat is off"
+msgstr ""
+
+#: src/screen.c:631
+msgid "Random is on"
+msgstr ""
+
+#: src/screen.c:632
+msgid "Random is off"
+msgstr ""
+
+#: src/screen.c:635
+#, c-format
+msgid "Crossfade %d seconds"
+msgstr ""
+
+#: src/screen.c:637
+msgid "Database updated!"
+msgstr ""
+
+#: src/screen.c:767
+msgid "Shuffled playlist!"
+msgstr ""
+
+#: src/screen.c:773
+msgid "Cleared playlist!"
+msgstr ""
+
+#: src/screen.c:800
+#, c-format
+msgid "Database update started [%d]"
+msgstr ""
+
+#: src/screen.c:803
+msgid "Database update running..."
+msgstr ""
+
+#: src/screen.c:824
+msgid "Find mode: Wrapped"
+msgstr ""
+
+#: src/screen.c:825
+msgid "Find mode: Normal"
+msgstr ""
+
+#: src/screen.c:830
+msgid "Auto center mode: On"
+msgstr ""
+
+#: src/screen.c:831
+msgid "Auto center mode: Off"
+msgstr ""
+
+#: src/screen_utils.c:36
+msgid "Find: "
+msgstr ""
+
+#: src/screen_utils.c:37
+msgid "Find backward: "
+msgstr ""
+
+#: src/screen_utils.c:144
+#, c-format
+msgid "Unable to find '%s'"
+msgstr ""
+
+#: src/screen_play.c:91
+msgid "Save playlist as: "
+msgstr ""
+
+#: src/screen_play.c:111
+#, c-format
+msgid "Error: Unable to save playlist as %s"
+msgstr ""
+
+#. success
+#: src/screen_play.c:118
+#, c-format
+msgid "Saved %s"
+msgstr ""
+
+#: src/screen_play.c:154
+msgid "Playlist"
+msgstr ""
+
+#. print a status message
+#: src/screen_play.c:339
+#, c-format
+msgid "Removed '%s' from playlist!"
+msgstr ""
+
+#: src/screen_file.c:151
+#, c-format
+msgid "Loading playlist %s..."
+msgstr ""
+
+#: src/screen_file.c:173
+msgid "You can only delete playlists!"
+msgstr ""
+
+#: src/screen_file.c:180
+#, c-format
+msgid "Delete playlist %s [y/n] ? "
+msgstr ""
+
+#: src/screen_file.c:187 src/screen_keydef.c:158
+msgid "Aborted!"
+msgstr ""
+
+#: src/screen_file.c:201
+msgid "Playlist deleted!"
+msgstr ""
+
+#: src/screen_file.c:235
+#, c-format
+msgid "Adding directory %s...\n"
+msgstr ""
+
+#: src/screen_file.c:305
+#, c-format
+msgid "Adding '%s' to playlist\n"
+msgstr ""
+
+#: src/screen_file.c:423
+msgid "Screen updated!"
+msgstr ""
+
+#: src/screen_keydef.c:45
+msgid "===> Apply & Save key bindings "
+msgstr ""
+
+#: src/screen_keydef.c:46
+msgid "===> Apply key bindings "
+msgstr ""
+
+#: src/screen_keydef.c:75
+msgid "You have new key bindings!"
+msgstr ""
+
+#: src/screen_keydef.c:78
+msgid "Keybindings unchanged."
+msgstr ""
+
+#: src/screen_keydef.c:89
+#, c-format
+msgid "Error: Unable to create direcory ~/.ncmpc - %s"
+msgstr ""
+
+#: src/screen_keydef.c:99 src/screen_keydef.c:105
+#, c-format
+msgid "Error: %s - %s"
+msgstr ""
+
+#: src/screen_keydef.c:107
+#, c-format
+msgid "Wrote %s"
+msgstr ""
+
+#: src/screen_keydef.c:135
+msgid "Deleted"
+msgstr ""
+
+#: src/screen_keydef.c:152
+#, c-format
+msgid "Enter new key for %s: "
+msgstr ""
+
+#: src/screen_keydef.c:164
+#, c-format
+msgid "Error: key %s is already used for %s"
+msgstr ""
+
+#: src/screen_keydef.c:171
+#, c-format
+msgid "Assigned %s to %s"
+msgstr ""
+
+#: src/screen_keydef.c:207
+#, c-format
+msgid "%d. Add new key "
+msgstr ""
+
+#: src/screen_keydef.c:254
+msgid "Welcome to the key editor!"
+msgstr ""
+
+#: src/screen_keydef.c:270
+msgid "Note: Did you forget to 'Apply' your changes?"
+msgstr ""
+
+#: src/screen_keydef.c:279
+msgid "Edit key bindings"
+msgstr ""
+
+#: src/screen_keydef.c:282
+#, c-format
+msgid "Edit keys for %s"
+msgstr ""
+
+#: src/command.c:65
+msgid "Play/Enter directory"
+msgstr ""
+
+#: src/command.c:67
+msgid "Pause"
+msgstr ""
+
+#: src/command.c:69
+msgid "Stop"
+msgstr ""
+
+#: src/command.c:71
+msgid "Next track"
+msgstr ""
+
+#: src/command.c:73
+msgid "Previous track"
+msgstr ""
+
+#: src/command.c:75
+msgid "Seek forward"
+msgstr ""
+
+#: src/command.c:77
+msgid "Seek backward"
+msgstr ""
+
+#: src/command.c:80
+msgid "Increase volume"
+msgstr ""
+
+#: src/command.c:82
+msgid "Decrease volume"
+msgstr ""
+
+#: src/command.c:85
+msgid "Toggle find mode"
+msgstr ""
+
+#: src/command.c:87
+msgid "Toggle auto center mode"
+msgstr ""
+
+#: src/command.c:90
+msgid "Select/deselect song in playlist"
+msgstr ""
+
+#: src/command.c:92
+msgid "Delete song from playlist"
+msgstr ""
+
+#: src/command.c:94
+msgid "Shuffle playlist"
+msgstr ""
+
+#: src/command.c:96
+msgid "Clear playlist"
+msgstr ""
+
+#: src/command.c:98
+msgid "Toggle repeat mode"
+msgstr ""
+
+#: src/command.c:100
+msgid "Toggle random mode"
+msgstr ""
+
+#: src/command.c:102
+msgid "Toggle crossfade mode"
+msgstr ""
+
+#: src/command.c:104
+msgid "Start a music database update"
+msgstr ""
+
+#: src/command.c:107
+msgid "Save playlist"
+msgstr ""
+
+#: src/command.c:110
+msgid "Move item up"
+msgstr ""
+
+#: src/command.c:112
+msgid "Move item down"
+msgstr ""
+
+#: src/command.c:115
+msgid "Move cursor up"
+msgstr ""
+
+#: src/command.c:117
+msgid "Move cursor down"
+msgstr ""
+
+#: src/command.c:119
+msgid "Home "
+msgstr ""
+
+#: src/command.c:121
+msgid "End "
+msgstr ""
+
+#: src/command.c:123
+msgid "Page up"
+msgstr ""
+
+#: src/command.c:125
+msgid "Page down"
+msgstr ""
+
+#: src/command.c:127
+msgid "Forward find"
+msgstr ""
+
+#: src/command.c:129
+msgid "Forward find next"
+msgstr ""
+
+#: src/command.c:131
+msgid "Backward find"
+msgstr ""
+
+#: src/command.c:133
+msgid "Backward find previous"
+msgstr ""
+
+#: src/command.c:137
+msgid "Next screen"
+msgstr ""
+
+#: src/command.c:140
+msgid "Previous screen"
+msgstr ""
+
+#: src/command.c:143
+msgid "Help screen"
+msgstr ""
+
+#: src/command.c:145
+msgid "Playlist screen"
+msgstr ""
+
+#: src/command.c:147
+msgid "Browse screen"
+msgstr ""
+
+#: src/command.c:149
+msgid "Update screen"
+msgstr ""
+
+#: src/command.c:152
+msgid "Key configuration screen"
+msgstr ""
+
+#: src/command.c:156
+msgid "Quit"
+msgstr ""
+
+#: src/command.c:177
+msgid "Undefined"
+msgstr ""
+
+#: src/command.c:179
+msgid "Space"
+msgstr ""
+
+#: src/command.c:181
+msgid "Enter"
+msgstr ""
+
+#: src/command.c:183
+msgid "Backspace"
+msgstr ""
+
+#: src/command.c:185
+msgid "Delete"
+msgstr ""
+
+#: src/command.c:187
+msgid "Up"
+msgstr ""
+
+#: src/command.c:189
+msgid "Down"
+msgstr ""
+
+#: src/command.c:191
+msgid "Left"
+msgstr ""
+
+#: src/command.c:193
+msgid "Right"
+msgstr ""
+
+#: src/command.c:195
+msgid "Home"
+msgstr ""
+
+#: src/command.c:197
+msgid "End"
+msgstr ""
+
+#: src/command.c:199
+msgid "PageDown"
+msgstr ""
+
+#: src/command.c:201
+msgid "PageUp"
+msgstr ""
+
+#: src/command.c:203
+msgid "Tab"
+msgstr ""
+
+#: src/command.c:205
+msgid "Shift+Tab"
+msgstr ""
+
+#: src/command.c:207
+msgid "Esc"
+msgstr ""
+
+#: src/command.c:209
+msgid "Insert"
+msgstr ""
+
+#: src/command.c:395
+#, c-format
+msgid "Error: Key %s assigned to %s and %s !!!\n"
+msgstr ""
+
+#: src/colors.c:191
+#, c-format
+msgid "Warning: Unknown color - %s\n"
+msgstr ""
+
+#: src/colors.c:236
+#, c-format
+msgid "Warning: Unknown color field - %s\n"
+msgstr ""
+
+#: src/colors.c:271
+msgid "Terminal lacks support for changing colors!\n"
+msgstr ""
+
+#: src/colors.c:288
+msgid "Terminal lacks color capabilities!\n"
+msgstr ""
+
+#: src/support.c:172
+#, c-format
+msgid "Error: Unable to convert characters to %s"
+msgstr ""
+
+#: src/support.c:201
+msgid "Error: Unable to convert characters to UTF-8"
+msgstr ""
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 000000000..c6fefcf84
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,545 @@
+# Swedish
+# Copyright (C) 2004 Kalle Wallin
+# This file is distributed under the same license as the ncmpc package.
+# Kalle Wallin <kaw@linux.se>, 2004
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ncmpc 0.11.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-05 20:20+0200\n"
+"PO-Revision-Date: 2004-06-05 18:16+0200\n"
+"Last-Translator: Kalle Wallin <kaw@linux.se>\n"
+"Language-Team: sv <sv@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:59
+msgid ""
+"\n"
+"Exiting...\n"
+msgstr ""
+"\n"
+"Avslutar...\n"
+
+#: src/main.c:89
+msgid "Confusing key bindings - exiting!\n"
+msgstr "Felaktiga tangent definitioner!\n"
+
+#: src/main.c:153
+#, c-format
+msgid "Lost connection to %s"
+msgstr "Ingen anslutning till %s"
+
+#: src/main.c:183
+#, c-format
+msgid "Connecting to %s... [Press Ctrl-C to abort]"
+msgstr "Ansluter till %s... [Tryck Ctrl-C för att avbryta]"
+
+#: src/main.c:190
+#, c-format
+msgid "Connected to %s!"
+msgstr "Ansluten till %s!"
+
+#: src/screen.c:131
+msgid ":Help "
+msgstr ":Hjälp "
+
+#: src/screen.c:135
+msgid ":Playlist "
+msgstr ":Spellista "
+
+#: src/screen.c:139
+msgid ":Browse"
+msgstr ":Filer "
+
+#: src/screen.c:143
+msgid "Volume n/a "
+msgstr "Volym: n/a "
+
+#: src/screen.c:147
+#, c-format
+msgid " Volume %d%%"
+msgstr " Volym: %d%%"
+
+#: src/screen.c:266
+msgid "Stopped! "
+msgstr "Stopped!"
+
+#: src/screen.c:269
+msgid "Playing:"
+msgstr "Spelar:"
+
+#: src/screen.c:272
+msgid "[Paused]"
+msgstr "[Pausad]"
+
+#: src/screen.c:382 src/screen.c:482
+msgid "Error: Screen to small!\n"
+msgstr "Fel: Terminal är för liten!\n"
+
+#: src/screen.c:627
+msgid "Repeat is on"
+msgstr "Repeat är på"
+
+#: src/screen.c:628
+msgid "Repeat is off"
+msgstr "Repeat är av"
+
+#: src/screen.c:631
+msgid "Random is on"
+msgstr "Random är på"
+
+#: src/screen.c:632
+msgid "Random is off"
+msgstr "Random är av"
+
+#: src/screen.c:635
+#, c-format
+msgid "Crossfade %d seconds"
+msgstr "Crossfade %d sekunder"
+
+#: src/screen.c:637
+msgid "Database updated!"
+msgstr "Databasen är uppdaterad!"
+
+#: src/screen.c:767
+msgid "Shuffled playlist!"
+msgstr "Slumpat spellistan!"
+
+#: src/screen.c:773
+msgid "Cleared playlist!"
+msgstr "Rensat spellistan!"
+
+#: src/screen.c:800
+#, c-format
+msgid "Database update started [%d]"
+msgstr "Uppdatering av databasen startad [%d]"
+
+#: src/screen.c:803
+msgid "Database update running..."
+msgstr "Databasen uppdateras..."
+
+#: src/screen.c:824
+msgid "Find mode: Wrapped"
+msgstr ""
+
+#: src/screen.c:825
+msgid "Find mode: Normal"
+msgstr ""
+
+#: src/screen.c:830
+msgid "Auto center mode: On"
+msgstr "Auto center mode: Off"
+
+#: src/screen.c:831
+msgid "Auto center mode: Off"
+msgstr "Auto center mode: Av"
+
+#: src/screen_utils.c:36
+msgid "Find: "
+msgstr "Sök: "
+
+#: src/screen_utils.c:37
+msgid "Find backward: "
+msgstr "Sök (bakåt): "
+
+#: src/screen_utils.c:144
+#, c-format
+msgid "Unable to find '%s'"
+msgstr "Hittar inte '%s'"
+
+#: src/screen_play.c:91
+msgid "Save playlist as: "
+msgstr "Spara spellistan som: "
+
+#: src/screen_play.c:111
+#, c-format
+msgid "Error: Unable to save playlist as %s"
+msgstr "Fel: Kan inte spara spellistan som %s"
+
+#. success
+#: src/screen_play.c:118
+#, c-format
+msgid "Saved %s"
+msgstr "Sparat %s"
+
+#: src/screen_play.c:154
+msgid "Playlist"
+msgstr "Spellista"
+
+#. print a status message
+#: src/screen_play.c:339
+#, c-format
+msgid "Removed '%s' from playlist!"
+msgstr "Tar bort '%s'!"
+
+#: src/screen_file.c:151
+#, c-format
+msgid "Loading playlist %s..."
+msgstr "Laddar %s..."
+
+#: src/screen_file.c:173
+msgid "You can only delete playlists!"
+msgstr "Du kan bara radera spellistor!"
+
+#: src/screen_file.c:180
+#, c-format
+msgid "Delete playlist %s [y/n] ? "
+msgstr "Radera '%s' [y/n] ? "
+
+#: src/screen_file.c:187 src/screen_keydef.c:158
+msgid "Aborted!"
+msgstr ""
+
+#: src/screen_file.c:201
+msgid "Playlist deleted!"
+msgstr "Spellistan raderad!"
+
+#: src/screen_file.c:235
+#, c-format
+msgid "Adding directory %s...\n"
+msgstr "Lägger till %s...\n"
+
+#: src/screen_file.c:305
+#, c-format
+msgid "Adding '%s' to playlist\n"
+msgstr "Lägger till '%s'...\n"
+
+#: src/screen_file.c:423
+msgid "Screen updated!"
+msgstr "Uppdaterat!"
+
+#: src/screen_keydef.c:45
+msgid "===> Apply & Save key bindings "
+msgstr "==> Verkställ och Spara"
+
+#: src/screen_keydef.c:46
+msgid "===> Apply key bindings "
+msgstr "==> Verkställ"
+
+#: src/screen_keydef.c:75
+msgid "You have new key bindings!"
+msgstr ""
+
+#: src/screen_keydef.c:78
+msgid "Keybindings unchanged."
+msgstr ""
+
+#: src/screen_keydef.c:89
+#, c-format
+msgid "Error: Unable to create direcory ~/.ncmpc - %s"
+msgstr "Fel: Kan inte skapa ~/.ncmpc - %s"
+
+#: src/screen_keydef.c:99 src/screen_keydef.c:105
+#, c-format
+msgid "Error: %s - %s"
+msgstr "Fel: %s - %s"
+
+#: src/screen_keydef.c:107
+#, c-format
+msgid "Wrote %s"
+msgstr "Sparade %s"
+
+#: src/screen_keydef.c:135
+msgid "Deleted"
+msgstr "Raderad"
+
+#: src/screen_keydef.c:152
+#, c-format
+msgid "Enter new key for %s: "
+msgstr "Ny tangent för %s: "
+
+#: src/screen_keydef.c:164
+#, c-format
+msgid "Error: key %s is already used for %s"
+msgstr "Tangenten %s används redan för %s"
+
+#: src/screen_keydef.c:171
+#, c-format
+msgid "Assigned %s to %s"
+msgstr ""
+
+#: src/screen_keydef.c:207
+#, c-format
+msgid "%d. Add new key "
+msgstr "%d. Lägg till"
+
+#: src/screen_keydef.c:254
+msgid "Welcome to the key editor!"
+msgstr ""
+
+#: src/screen_keydef.c:270
+msgid "Note: Did you forget to 'Apply' your changes?"
+msgstr "OBS! Du glömde väl inte att Verkställa?"
+
+#: src/screen_keydef.c:279
+msgid "Edit key bindings"
+msgstr "Ändra tangent bindingar"
+
+#: src/screen_keydef.c:282
+#, c-format
+msgid "Edit keys for %s"
+msgstr "Ändra tangenter för %s"
+
+#: src/command.c:65
+msgid "Play/Enter directory"
+msgstr ""
+
+#: src/command.c:67
+msgid "Pause"
+msgstr ""
+
+#: src/command.c:69
+msgid "Stop"
+msgstr "Stop"
+
+#: src/command.c:71
+msgid "Next track"
+msgstr "Nästa"
+
+#: src/command.c:73
+msgid "Previous track"
+msgstr "Föregånde"
+
+#: src/command.c:75
+msgid "Seek forward"
+msgstr "Sök bakåt"
+
+#: src/command.c:77
+msgid "Seek backward"
+msgstr "Sök (bakåt): "
+
+#: src/command.c:80
+msgid "Increase volume"
+msgstr "Öka volymen"
+
+#: src/command.c:82
+msgid "Decrease volume"
+msgstr "Minska volymen"
+
+#: src/command.c:85
+msgid "Toggle find mode"
+msgstr ""
+
+#: src/command.c:87
+msgid "Toggle auto center mode"
+msgstr "Auto center mode Av/På"
+
+#: src/command.c:90
+msgid "Select/deselect song in playlist"
+msgstr "Lägg till/Ta bort"
+
+#: src/command.c:92
+msgid "Delete song from playlist"
+msgstr "Ta bort ifrån spellistan"
+
+#: src/command.c:94
+msgid "Shuffle playlist"
+msgstr "Slumpa spellista"
+
+#: src/command.c:96
+msgid "Clear playlist"
+msgstr "Rensa spellistan"
+
+#: src/command.c:98
+msgid "Toggle repeat mode"
+msgstr "Repeat På/Av"
+
+#: src/command.c:100
+msgid "Toggle random mode"
+msgstr "Random På/Av"
+
+#: src/command.c:102
+msgid "Toggle crossfade mode"
+msgstr "Crossfade På/Av"
+
+#: src/command.c:104
+msgid "Start a music database update"
+msgstr "Updatera databasen"
+
+#: src/command.c:107
+msgid "Save playlist"
+msgstr "Spara spellista"
+
+#: src/command.c:110
+msgid "Move item up"
+msgstr "Flytta upp"
+
+#: src/command.c:112
+msgid "Move item down"
+msgstr "Flytta ner"
+
+#: src/command.c:115
+msgid "Move cursor up"
+msgstr "Förflytta markören nedåt"
+
+#: src/command.c:117
+msgid "Move cursor down"
+msgstr "Förflytta markören uppåt"
+
+#: src/command.c:119
+msgid "Home "
+msgstr ""
+
+#: src/command.c:121
+msgid "End "
+msgstr ""
+
+#: src/command.c:123
+msgid "Page up"
+msgstr ""
+
+#: src/command.c:125
+msgid "Page down"
+msgstr ""
+
+#: src/command.c:127
+msgid "Forward find"
+msgstr "Sök"
+
+#: src/command.c:129
+msgid "Forward find next"
+msgstr "Upprepa Sökning"
+
+#: src/command.c:131
+msgid "Backward find"
+msgstr "Sök bakåt"
+
+#: src/command.c:133
+msgid "Backward find previous"
+msgstr "Upprepa Sökning bakåt"
+
+#: src/command.c:137
+msgid "Next screen"
+msgstr "Nästa skärm"
+
+#: src/command.c:140
+msgid "Previous screen"
+msgstr "Tidigare skärm"
+
+#: src/command.c:143
+msgid "Help screen"
+msgstr "Hjälp"
+
+#: src/command.c:145
+msgid "Playlist screen"
+msgstr "Spellista"
+
+#: src/command.c:147
+msgid "Browse screen"
+msgstr "Filer"
+
+#: src/command.c:149
+msgid "Update screen"
+msgstr "Updatera"
+
+#: src/command.c:152
+msgid "Key configuration screen"
+msgstr "Tangentbindningar"
+
+#: src/command.c:156
+msgid "Quit"
+msgstr "Avsluta"
+
+#: src/command.c:177
+msgid "Undefined"
+msgstr "Ej definerad"
+
+#: src/command.c:179
+msgid "Space"
+msgstr "Mellanslag"
+
+#: src/command.c:181
+msgid "Enter"
+msgstr ""
+
+#: src/command.c:183
+msgid "Backspace"
+msgstr ""
+
+#: src/command.c:185
+msgid "Delete"
+msgstr ""
+
+#: src/command.c:187
+msgid "Up"
+msgstr ""
+
+#: src/command.c:189
+msgid "Down"
+msgstr ""
+
+#: src/command.c:191
+msgid "Left"
+msgstr ""
+
+#: src/command.c:193
+msgid "Right"
+msgstr ""
+
+#: src/command.c:195
+msgid "Home"
+msgstr ""
+
+#: src/command.c:197
+msgid "End"
+msgstr ""
+
+#: src/command.c:199
+msgid "PageDown"
+msgstr ""
+
+#: src/command.c:201
+msgid "PageUp"
+msgstr ""
+
+#: src/command.c:203
+msgid "Tab"
+msgstr ""
+
+#: src/command.c:205
+msgid "Shift+Tab"
+msgstr ""
+
+#: src/command.c:207
+msgid "Esc"
+msgstr ""
+
+#: src/command.c:209
+msgid "Insert"
+msgstr ""
+
+#: src/command.c:395
+#, c-format
+msgid "Error: Key %s assigned to %s and %s !!!\n"
+msgstr "Fel: Tangenten %s är tilldelad både %s och %s !!!\n"
+
+#: src/colors.c:191
+#, c-format
+msgid "Warning: Unknown color - %s\n"
+msgstr "Varning: Känner inte till färgen %s\n"
+
+#: src/colors.c:236
+#, c-format
+msgid "Warning: Unknown color field - %s\n"
+msgstr "Varning: %s ej definerad.\n"
+
+#: src/colors.c:271
+msgid "Terminal lacks support for changing colors!\n"
+msgstr "Terminalen saknar stöd för omdefinition av färger!\n"
+
+#: src/colors.c:288
+msgid "Terminal lacks color capabilities!\n"
+msgstr "Terminalen saknar stöd för färger!\n"
+
+#: src/support.c:172
+#, c-format
+msgid "Error: Unable to convert characters to %s"
+msgstr "Fel vid konvertering av tecken från UTF-8 till %s"
+
+#: src/support.c:201
+msgid "Error: Unable to convert characters to UTF-8"
+msgstr "Fel vid konvertering av tecken till UTF-8"
diff --git a/src/Makefile.am b/src/Makefile.am
index abf121cb2..59a7f4a70 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,9 +4,14 @@
bin_PROGRAMS = ncmpc
+ncmpc_LDADD = $(GLIB_LIBS)
+
+AM_CPPFLAGS = $(GLIB_CFLAGS) -DLOCALE_DIR=\""$(datadir)/locale"\" -DSYSCONFDIR=\""$(sysconfdir)"\"
+
+
ncmpc_headers = libmpdclient.h mpc.h options.h conf.h command.h screen.h \
screen_utils.h screen_play.h screen_file.h screen_search.h \
- screen_help.h list_window.h colors.h support.h
+ screen_help.h list_window.h colors.h support.h ncmpc.h
ncmpc_SOURCES = libmpdclient.c main.c mpc.c options.c conf.c command.c \
screen.c screen_utils.c screen_play.c screen_file.c \
diff --git a/src/colors.c b/src/colors.c
index f70969390..bfb4c316c 100644
--- a/src/colors.c
+++ b/src/colors.c
@@ -23,6 +23,7 @@
#include <glib.h>
#include "config.h"
+#include "ncmpc.h"
#include "options.h"
#include "support.h"
#include "colors.h"
@@ -187,7 +188,7 @@ colors_str2color(char *str)
return COLOR_BRIGHT_BLACK;
else if( !strcasecmp(str,"none") )
return -1;
- fprintf(stderr,"Warning: Unknown color - %s\n", str);
+ fprintf(stderr,_("Warning: Unknown color - %s\n"), str);
return -2;
}
@@ -232,7 +233,7 @@ colors_assign(char *name, char *value)
bg = color;
return 0;
}
- fprintf(stderr,"Warning: Unknown color field - %s\n", name);
+ fprintf(stderr,_("Warning: Unknown color field - %s\n"), name);
return -1;
}
@@ -267,7 +268,7 @@ colors_start(void)
}
}
else if( !can_change_color() )
- fprintf(stderr, "Terminal lacks support for changing colors!\n");
+ fprintf(stderr, _("Terminal lacks support for changing colors!\n"));
if( options.enable_colors )
{
@@ -284,7 +285,7 @@ colors_start(void)
}
else if( options.enable_colors )
{
- fprintf(stderr, "Terminal lacks color capabilities!\n");
+ fprintf(stderr, _("Terminal lacks color capabilities!\n"));
options.enable_colors = 0;
}
diff --git a/src/command.c b/src/command.c
index bb7dd7bc2..78199f252 100644
--- a/src/command.c
+++ b/src/command.c
@@ -25,6 +25,7 @@
#include <ncurses.h>
#include "config.h"
+#include "ncmpc.h"
#include "command.h"
#undef DEBUG_KEYS
@@ -61,98 +62,98 @@ extern void screen_resize(void);
static command_definition_t cmds[] =
{
{ { 13, 0, 0 }, CMD_PLAY, "play",
- "Play/Enter directory" },
+ N_("Play/Enter directory") },
{ { 'P', 0, 0 }, CMD_PAUSE,"pause",
- "Pause" },
+ N_("Pause") },
{ { 's', BS, 0 }, CMD_STOP, "stop",
- "Stop" },
+ N_("Stop") },
{ { '>', 0, 0 }, CMD_TRACK_NEXT, "next",
- "Next track" },
+ N_("Next track") },
{ { '<', 0, 0 }, CMD_TRACK_PREVIOUS, "prev",
- "Previous track" },
+ N_("Previous track") },
{ { 'f', 0, 0 }, CMD_SEEK_FORWARD, "seek-forward",
- "Seek forward" },
+ N_("Seek forward") },
{ { 'b', 0, 0 }, CMD_SEEK_BACKWARD, "seek-backward",
- "Seek backward" },
+ N_("Seek backward") },
{ { '+', RGHT, 0 }, CMD_VOLUME_UP, "volume-up",
- "Increase volume" },
+ N_("Increase volume") },
{ { '-', LEFT, 0 }, CMD_VOLUME_DOWN, "volume-down",
- "Decrease volume" },
+ N_("Decrease volume") },
{ { 'w', 0, 0 }, CMD_TOGGLE_FIND_WRAP, "wrap-mode",
- "Toggle find mode" },
+ N_("Toggle find mode") },
{ { 'U', 0, 0 }, CMD_TOGGLE_AUTOCENTER, "autocenter-mode",
- "Toggle auto center mode" },
+ N_("Toggle auto center mode") },
{ { ' ', 'a', 0 }, CMD_SELECT, "select",
- "Select/deselect song in playlist" },
+ N_("Select/deselect song in playlist") },
{ { DEL, 'd', 0 }, CMD_DELETE, "delete",
- "Delete song from playlist" },
+ N_("Delete song from playlist") },
{ { 'Z', 0, 0 }, CMD_SHUFFLE, "shuffle",
- "Shuffle playlist" },
+ N_("Shuffle playlist") },
{ { 'c', 0, 0 }, CMD_CLEAR, "clear",
- "Clear playlist" },
+ N_("Clear playlist") },
{ { 'r', 0, 0 }, CMD_REPEAT, "repeat",
- "Toggle repeat mode" },
+ N_("Toggle repeat mode") },
{ { 'z', 0, 0 }, CMD_RANDOM, "random",
- "Toggle random mode" },
+ N_("Toggle random mode") },
{ { 'x', 0, 0 }, CMD_CROSSFADE, "crossfade",
- "Toggle crossfade mode" },
+ N_("Toggle crossfade mode") },
{ { 21, 0, 0 }, CMD_DB_UPDATE, "db-update",
- "Start a music database update" },
+ N_("Start a music database update") },
{ { 'S', 0, 0 }, CMD_SAVE_PLAYLIST, "save",
- "Save playlist" },
+ N_("Save playlist") },
{ { 0, 0, 0 }, CMD_LIST_MOVE_UP, "move-up",
- "Move item up" },
+ N_("Move item up") },
{ { 0, 0, 0 }, CMD_LIST_MOVE_DOWN, "move-down",
- "Move item down" },
+ N_("Move item down") },
{ { UP, ',', 0 }, CMD_LIST_PREVIOUS, "up",
- "Move cursor up" },
+ N_("Move cursor up") },
{ { DWN, '.', 0 }, CMD_LIST_NEXT, "down",
- "Move cursor down" },
+ N_("Move cursor down") },
{ { HOME, 0x01, 0 }, CMD_LIST_FIRST, "home",
- "Home " },
+ N_("Home ") },
{ { END, 0x05, 0 }, CMD_LIST_LAST, "end",
- "End " },
+ N_("End ") },
{ { PGUP, 'A', 0 }, CMD_LIST_PREVIOUS_PAGE, "pgup",
- "Page up" },
+ N_("Page up") },
{ { PGDN, 'B', 0 }, CMD_LIST_NEXT_PAGE, "pgdn",
- "Page down" },
+ N_("Page down") },
{ { '/', 0, 0 }, CMD_LIST_FIND, "find",
- "Forward find" },
+ N_("Forward find") },
{ { 'n', 0, 0 }, CMD_LIST_FIND_NEXT, "find-next",
- "Forward find next" },
+ N_("Forward find next") },
{ { '?', 0, 0 }, CMD_LIST_RFIND, "rfind",
- "Backward find" },
+ N_("Backward find") },
{ { 'p', 0, 0 }, CMD_LIST_RFIND_NEXT, "rfind-next",
- "Backward find previous" },
+ N_("Backward find previous") },
{ { TAB, 0, 0 }, CMD_SCREEN_NEXT, "screen-next",
- "Next screen" },
+ N_("Next screen") },
{ { STAB, 0, 0 }, CMD_SCREEN_PREVIOUS, "screen-prev",
- "Previous screen" },
+ N_("Previous screen") },
{ { '1', F1, 'h' }, CMD_SCREEN_HELP, "screen-help",
- "Help screen" },
+ N_("Help screen") },
{ { '2', F2, 0 }, CMD_SCREEN_PLAY, "screen-playlist",
- "Playlist screen" },
+ N_("Playlist screen") },
{ { '3', F3, 0 }, CMD_SCREEN_FILE, "screen-browse",
- "Browse screen" },
+ N_("Browse screen") },
{ {'u', 0, 0 }, CMD_SCREEN_UPDATE, "update",
- "Update screen" },
+ N_("Update screen") },
#ifdef ENABLE_KEYDEF_SCREEN
{ {'K', 0, 0 }, CMD_SCREEN_KEYDEF, "screen-keyedit",
- "Key configuration screen" },
+ N_("Key configuration screen") },
#endif
{ { 'q', 0, 0 }, CMD_QUIT, "quit",
- "Quit " PACKAGE },
+ N_("Quit") },
{ { -1, -1, -1 }, CMD_NONE, NULL, NULL }
};
@@ -173,39 +174,39 @@ key2str(int key)
switch(key)
{
case 0:
- return "Undefined";
+ return _("Undefined");
case ' ':
- return "Space";
+ return _("Space");
case 13:
- return "Enter";
+ return _("Enter");
case BS:
- return "Backspace";
+ return _("Backspace");
case DEL:
- return "Delete";
+ return _("Delete");
case UP:
- return "Up";
+ return _("Up");
case DWN:
- return "Down";
+ return _("Down");
case LEFT:
- return "Left";
+ return _("Left");
case RGHT:
- return "Right";
+ return _("Right");
case HOME:
- return "Home";
+ return _("Home");
case END:
- return "End";
+ return _("End");
case PGDN:
- return "PageDown";
+ return _("PageDown");
case PGUP:
- return "PageUp";
+ return _("PageUp");
case TAB:
- return "Tab";
+ return _("Tab");
case STAB:
- return "Shift+Tab";
+ return _("Shift+Tab");
case ESC:
- return "Esc";
+ return _("Esc");
case KEY_IC:
- return "Insert";
+ return _("Insert");
default:
for(i=0; i<=63; i++)
if( key==KEY_F(i) )
@@ -278,7 +279,7 @@ get_key_description(command_t command)
while( cmds[i].description )
{
if( cmds[i].command == command )
- return cmds[i].description;
+ return _(cmds[i].description);
i++;
}
return NULL;
@@ -391,7 +392,7 @@ check_key_bindings(void)
if( cmds[i].keys[j] &&
(cmd=get_key_command(cmds[i].keys[j])) != cmds[i].command )
{
- fprintf(stderr, "Error: Key %s assigned to %s and %s !!!\n",
+ fprintf(stderr, _("Error: Key %s assigned to %s and %s !!!\n"),
key2str(cmds[i].keys[j]),
get_key_command_name(cmds[i].command),
get_key_command_name(cmd));
diff --git a/src/conf.c b/src/conf.c
index 06866c13e..cb8ba0eb2 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -28,20 +28,14 @@
#include <glib.h>
#include <ncurses.h>
-
#include "config.h"
+#include "ncmpc.h"
#include "options.h"
#include "support.h"
#include "command.h"
#include "colors.h"
#include "conf.h"
-#ifdef DEBUG
-#define D(x) x
-#else
-#define D(x)
-#endif
-
#define ENABLE_OLD_COLOR_SYNTAX
#define MAX_LINE_LENGTH 1024
@@ -111,14 +105,18 @@ parse_key_value(char *str, size_t len, char **end)
else if( isdigit(c) )
state = KEY_PARSER_DEC;
else {
- fprintf(stderr, "Error: Unsupported key definition - %s\n", str);
+ fprintf(stderr,
+ _("Error: Unsupported key definition - %s\n"),
+ str);
return -1;
}
break;
case KEY_PARSER_CHAR:
if( next!='\'' )
{
- fprintf(stderr, "Error: Unsupported key definition - %s\n", str);
+ fprintf(stderr,
+ _("Error: Unsupported key definition - %s\n"),
+ str);
return -1;
}
value = c;
@@ -132,7 +130,7 @@ parse_key_value(char *str, size_t len, char **end)
case KEY_PARSER_HEX:
if( !isdigit(next) )
{
- fprintf(stderr, "Error: Digit expexted after 0x - %s\n", str);
+ fprintf(stderr,_("Error: Digit expexted after 0x - %s\n"), str);
return -1;
}
value = (int) strtol(str+(i+1), end, 16);
@@ -168,7 +166,7 @@ parse_key_definition(char *str)
buf[j++] = str[i++];
if( (cmd=get_key_command_from_name(buf)) == CMD_NONE )
{
- fprintf(stderr, "Error: Unknown key command %s\n", buf);
+ fprintf(stderr, _("Error: Unknown key command %s\n"), buf);
return -1;
}
@@ -182,7 +180,7 @@ parse_key_definition(char *str)
len = strlen(buf);
if( len==0 )
{
- fprintf(stderr,"Error: Incomplete key definition - %s\n", str);
+ fprintf(stderr,_("Error: Incomplete key definition - %s\n"), str);
return -1;
}
@@ -202,7 +200,7 @@ parse_key_definition(char *str)
}
if( key<0 )
{
- fprintf(stderr,"Error: Bad key definition - %s\n", str);
+ fprintf(stderr,_("Error: Bad key definition - %s\n"), str);
return -1;
}
@@ -254,7 +252,7 @@ parse_color_definition(char *str)
color=colors_str2color(buf);
if( color<0 )
{
- fprintf(stderr, "Error: Bad color %s [%d]\n", buf, color);
+ fprintf(stderr,_("Error: Bad color %s [%d]\n"), buf, color);
return -1;
}
name = g_strdup(buf);
@@ -269,7 +267,7 @@ parse_color_definition(char *str)
len = strlen(buf);
if( len==0 )
{
- fprintf(stderr,"Error: Incomplete color definition - %s\n", str);
+ fprintf(stderr,_("Error: Incomplete color definition - %s\n"), str);
g_free(name);
return -1;
}
@@ -290,7 +288,7 @@ parse_color_definition(char *str)
}
if( value<0 || i!=3)
{
- fprintf(stderr,"Error: Bad color definition - %s\n", str);
+ fprintf(stderr,_("Error: Bad color definition - %s\n"), str);
g_free(name);
return -1;
}
@@ -469,7 +467,7 @@ read_rc_file(char *filename, options_t *options)
if( !match_found )
fprintf(stderr,
- "Unknown configuration parameter: %s\n",
+ _("Unknown configuration parameter: %s\n"),
name);
#ifdef DEBUG
printf( " %s = %s %s\n",
diff --git a/src/main.c b/src/main.c
index bb3740b62..15ecf4532 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,7 @@
#include <glib.h>
#include "config.h"
+#include "ncmpc.h"
#include "libmpdclient.h"
#include "support.h"
#include "mpc.h"
@@ -31,13 +32,6 @@
#include "screen.h"
#include "conf.h"
-/* time in seconds between mpd updates (double) */
-#define MPD_UPDATE_TIME 0.5
-
-/* timout in seconds before trying to reconnect (int) */
-#define MPD_RECONNECT_TIMEOUT 3
-
-
static mpd_client_t *mpc = NULL;
static GTimer *timer = NULL;
@@ -62,7 +56,7 @@ exit_and_cleanup(void)
void
catch_sigint( int sig )
{
- printf( "\nExiting...\n");
+ printf( _("\nExiting...\n"));
exit(EXIT_SUCCESS);
}
@@ -73,6 +67,13 @@ main(int argc, const char *argv[])
struct sigaction act;
gboolean connected;
+ /* initialize i18n support */
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
+ textdomain(GETTEXT_PACKAGE);
+#endif
+
/* initialize options */
options = options_init();
@@ -85,7 +86,7 @@ main(int argc, const char *argv[])
/* check key bindings */
if( check_key_bindings() )
{
- fprintf(stderr, "Confusing key bindings - exiting!\n");
+ fprintf(stderr, _("Confusing key bindings - exiting!\n"));
exit(EXIT_FAILURE);
}
@@ -149,7 +150,7 @@ main(int argc, const char *argv[])
}
else if( mpc_error(mpc) )
{
- screen_status_printf("Lost connection to %s", options->host);
+ screen_status_printf(_("Lost connection to %s"), options->host);
connected = FALSE;
doupdate();
mpd_clearError(mpc->connection);
@@ -179,14 +180,14 @@ main(int argc, const char *argv[])
else if( options->reconnect )
{
sleep(MPD_RECONNECT_TIMEOUT);
- screen_status_printf("Connecting to %s... [Press Ctrl-C to abort]",
+ screen_status_printf(_("Connecting to %s... [Press Ctrl-C to abort]"),
options->host);
if( mpc_reconnect(mpc,
options->host,
options->port,
options->password) == 0 )
{
- screen_status_printf("Connected to %s!", options->host);
+ screen_status_printf(_("Connected to %s!"), options->host);
connected = TRUE;
}
doupdate();
diff --git a/src/screen.c b/src/screen.c
index 4059ac24f..94b3dc860 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -21,12 +21,12 @@
#include <stdarg.h>
#include <string.h>
#include <time.h>
-//#include <signal.h>
#include <locale.h>
#include <glib.h>
#include <ncurses.h>
#include "config.h"
+#include "ncmpc.h"
#include "libmpdclient.h"
#include "mpc.h"
#include "command.h"
@@ -128,23 +128,23 @@ paint_top_window(char *header, mpd_client_t *c, int clear)
colors_use(w, COLOR_TITLE_BOLD);
waddstr(w, get_key_names(CMD_SCREEN_HELP, FALSE));
colors_use(w, COLOR_TITLE);
- waddstr(w, ":Help ");
+ waddstr(w, _(":Help "));
colors_use(w, COLOR_TITLE_BOLD);
waddstr(w, get_key_names(CMD_SCREEN_PLAY, FALSE));
colors_use(w, COLOR_TITLE);
- waddstr(w, ":Playlist ");
+ waddstr(w, _(":Playlist "));
colors_use(w, COLOR_TITLE_BOLD);
waddstr(w, get_key_names(CMD_SCREEN_FILE, FALSE));
colors_use(w, COLOR_TITLE);
- waddstr(w, ":Browse");
+ waddstr(w, _(":Browse"));
}
if( c->status->volume==MPD_STATUS_NO_VOLUME )
{
- snprintf(buf, 32, "Volume n/a ");
+ snprintf(buf, 32, _("Volume n/a "));
}
else
{
- snprintf(buf, 32, " Volume %d%%", c->status->volume);
+ snprintf(buf, 32, _(" Volume %d%%"), c->status->volume);
}
colors_use(w, COLOR_TITLE);
mvwaddstr(w, 0, screen->top_window.cols-strlen(buf), buf);
@@ -263,13 +263,13 @@ paint_status_window(mpd_client_t *c)
switch(status->state)
{
case MPD_STATUS_STATE_STOP:
- waddstr(w, "Stopped! ");
+ waddstr(w, _("Stopped! "));
break;
case MPD_STATUS_STATE_PLAY:
- waddstr(w, "Playing:");
+ waddstr(w, _("Playing:"));
break;
case MPD_STATUS_STATE_PAUSE:
- waddstr(w, "[Paused]");
+ waddstr(w, _("[Paused]"));
break;
default:
break;
@@ -330,20 +330,6 @@ paint_status_window(mpd_client_t *c)
mvwaddstr(w, 0, x, screen->buf);
}
-#ifdef ENABLE_STATUS_LINE_CLOCK
- else if( c->status->state == MPD_STATUS_STATE_STOP )
- {
- time_t timep;
-
- /* Note: setlocale(LC_TIME,"") should be used first */
- time(&timep);
- strftime(screen->buf, screen->buf_size, "%X ", localtime(&timep));
- x = screen->status_window.cols - strlen(screen->buf) ;
- colors_use(w, COLOR_STATUS_TIME);
- mvwaddstr(w, 0, x, screen->buf);
- }
-#endif
-
wnoutrefresh(w);
}
@@ -393,7 +379,7 @@ screen_resize(void)
if( COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS )
{
screen_exit();
- fprintf(stderr, "Error: Screen to small!\n");
+ fprintf(stderr, _("Error: Screen to small!\n"));
exit(EXIT_FAILURE);
}
@@ -493,7 +479,7 @@ screen_init(void)
if( COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS )
{
- fprintf(stderr, "Error: Screen to small!\n");
+ fprintf(stderr, _("Error: Screen to small!\n"));
exit(EXIT_FAILURE);
}
@@ -637,15 +623,18 @@ screen_update(mpd_client_t *c)
dbupdate = c->status->updatingDb;
}
if( repeat != c->status->repeat )
- screen_status_printf("Repeat is %s",
- c->status->repeat ? "On" : "Off");
+ screen_status_printf(c->status->repeat ?
+ _("Repeat is on") :
+ _("Repeat is off"));
if( random != c->status->random )
- screen_status_printf("Random is %s",
- c->status->random ? "On" : "Off");
+ screen_status_printf(c->status->random ?
+ _("Random is on") :
+ _("Random is off"));
+
if( crossfade != c->status->crossfade )
- screen_status_printf("Crossfade %d seconds", c->status->crossfade);
+ screen_status_printf(_("Crossfade %d seconds"), c->status->crossfade);
if( dbupdate && dbupdate != c->status->updatingDb )
- screen_status_printf("Database updated!");
+ screen_status_printf(_("Database updated!"));
repeat = c->status->repeat;
random = c->status->random;
@@ -775,13 +764,13 @@ screen_cmd(mpd_client_t *c, command_t cmd)
case CMD_SHUFFLE:
mpd_sendShuffleCommand(c->connection);
mpd_finishCommand(c->connection);
- screen_status_message("Shuffled playlist!");
+ screen_status_message(_("Shuffled playlist!"));
break;
case CMD_CLEAR:
mpd_sendClearCommand(c->connection);
mpd_finishCommand(c->connection);
file_clear_highlights(c);
- screen_status_message("Cleared playlist!");
+ screen_status_message(_("Cleared playlist!"));
break;
case CMD_REPEAT:
n = !c->status->repeat;
@@ -808,10 +797,10 @@ screen_cmd(mpd_client_t *c, command_t cmd)
n = mpd_getUpdateId(c->connection);
mpd_finishCommand(c->connection);
if( !mpc_error(c) )
- screen_status_printf("Database update started [%d]", n);
+ screen_status_printf(_("Database update started [%d]"), n);
}
else
- screen_status_printf("Database update running...");
+ screen_status_printf(_("Database update running..."));
break;
case CMD_VOLUME_UP:
if( c->status->volume!=MPD_STATUS_NO_VOLUME && c->status->volume<100 )
@@ -831,13 +820,15 @@ screen_cmd(mpd_client_t *c, command_t cmd)
break;
case CMD_TOGGLE_FIND_WRAP:
options.find_wrap = !options.find_wrap;
- screen_status_printf("Find mode: %s",
- options.find_wrap ? "Wrapped" : "Normal");
+ screen_status_printf(options.find_wrap ?
+ _("Find mode: Wrapped") :
+ _("Find mode: Normal"));
break;
case CMD_TOGGLE_AUTOCENTER:
options.auto_center = !options.auto_center;
- screen_status_printf("Auto center mode: %s",
- options.auto_center ? "On" : "Off");
+ screen_status_printf(options.auto_center ?
+ _("Auto center mode: On") :
+ _("Auto center mode: Off"));
break;
case CMD_SCREEN_PREVIOUS:
if( screen->mode > SCREEN_PLAY_WINDOW )
diff --git a/src/screen.h b/src/screen.h
index a7e6b7250..00cd35530 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -14,12 +14,6 @@
#define SCREEN_MIN_COLS 14
#define SCREEN_MIN_ROWS 5
-/* timeout for non blocking read [ms] */
-#define SCREEN_TIMEOUT 500
-
-/* welcome message time [s] */
-#define SCREEN_WELCOME_TIME 10
-
#define IS_PLAYING(s) (s==MPD_STATUS_STATE_PLAY)
#define IS_PAUSED(s) (s==MPD_STATUS_STATE_PAUSE)
#define IS_STOPPED(s) (!(IS_PLAYING(s) | IS_PAUSED(s)))
diff --git a/src/screen_file.c b/src/screen_file.c
index d2b1f7844..be5e1eb9e 100644
--- a/src/screen_file.c
+++ b/src/screen_file.c
@@ -23,6 +23,7 @@
#include <ncurses.h>
#include "config.h"
+#include "ncmpc.h"
#include "support.h"
#include "libmpdclient.h"
#include "mpc.h"
@@ -147,7 +148,7 @@ load_playlist(screen_t *screen, mpd_client_t *c, filelist_entry_t *entry)
mpd_sendLoadCommand(c->connection, plf->path);
mpd_finishCommand(c->connection);
- screen_status_printf("Loading playlist %s...", filename);
+ screen_status_printf(_("Loading playlist %s..."), filename);
g_free(filename);
return 0;
}
@@ -169,21 +170,21 @@ handle_delete(screen_t *screen, mpd_client_t *c)
if( entity->type!=MPD_INFO_ENTITY_TYPE_PLAYLISTFILE )
{
- screen_status_printf("You can only delete playlists!");
+ screen_status_printf(_("You can only delete playlists!"));
beep();
return -1;
}
plf = entity->info.playlistFile;
str = utf8_to_locale(basename(plf->path));
- snprintf(buf, BUFSIZE, "Delete playlist %s [y/n] ? ", str);
+ snprintf(buf, BUFSIZE, _("Delete playlist %s [y/n] ? "), str);
g_free(str);
key = tolower(screen_getch(screen->status_window.w, buf));
if( key==KEY_RESIZE )
screen_resize();
if( key!='y' )
{
- screen_status_printf("Aborted!");
+ screen_status_printf(_("Aborted!"));
return 0;
}
@@ -197,7 +198,7 @@ handle_delete(screen_t *screen, mpd_client_t *c)
beep();
return -1;
}
- screen_status_printf("Playlist deleted!");
+ screen_status_printf(_("Playlist deleted!"));
mpc_update_filelist(c);
list_window_check_selected(lw, c->filelist_length);
return 0;
@@ -231,7 +232,7 @@ add_directory(mpd_client_t *c, char *dir)
char *dirname;
dirname = utf8_to_locale(dir);
- screen_status_printf("Adding directory %s...\n", dirname);
+ screen_status_printf(_("Adding directory %s...\n"), dirname);
doupdate();
g_free(dirname);
dirname = NULL;
@@ -301,7 +302,7 @@ handle_select(screen_t *screen, mpd_client_t *c)
playlist_add_song(c, song);
- screen_status_printf("Adding \'%s\' to playlist\n",
+ screen_status_printf(_("Adding \'%s\' to playlist\n"),
mpc_get_song_name(song));
}
}
@@ -366,7 +367,8 @@ file_title(void)
tmp = utf8_to_locale(basename(mpc->cwd));
snprintf(buf, TITLESIZE,
- TOP_HEADER_FILE ": %s ",
+ "%s : %s ",
+ _(TOP_HEADER_FILE) ,
tmp
);
g_free(tmp);
@@ -418,7 +420,7 @@ file_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
case CMD_SCREEN_UPDATE:
mpc_update_filelist(c);
list_window_check_selected(lw, c->filelist_length);
- screen_status_printf("Screen updated!");
+ screen_status_printf(_("Screen updated!"));
return 1;
case CMD_LIST_FIND:
case CMD_LIST_RFIND:
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index 4bda6ea21..3e2c921bc 100644
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
@@ -25,6 +25,7 @@
#include "config.h"
#ifdef ENABLE_KEYDEF_SCREEN
+#include "ncmpc.h"
#include "libmpdclient.h"
#include "options.h"
#include "conf.h"
@@ -41,8 +42,8 @@
#define LIST_ITEM_SAVE() (LIST_ITEM_APPLY()+1)
#define LIST_LENGTH() (LIST_ITEM_SAVE()+1)
-#define LIST_ITEM_SAVE_LABEL "===> Apply & Save key bindings "
-#define LIST_ITEM_APPLY_LABEL "===> Apply key bindings "
+#define LIST_ITEM_SAVE_LABEL _("===> Apply & Save key bindings ")
+#define LIST_ITEM_APPLY_LABEL _("===> Apply key bindings ")
static list_window_t *lw = NULL;
@@ -71,10 +72,10 @@ apply_keys(void)
size_t size = command_list_length*sizeof(command_definition_t);
memcpy(orginal_cmds, cmds, size);
- screen_status_printf("You have new key bindings!");
+ screen_status_printf(_("You have new key bindings!"));
}
else
- screen_status_printf("Keybindings unchanged.");
+ screen_status_printf(_("Keybindings unchanged."));
}
static int
@@ -85,7 +86,7 @@ save_keys(void)
if( check_user_conf_dir() )
{
- screen_status_printf("Error: Unable to create direcory ~/.ncmpc - %s",
+ screen_status_printf(_("Error: Unable to create direcory ~/.ncmpc - %s"),
strerror(errno));
beep();
return -1;
@@ -95,15 +96,15 @@ save_keys(void)
if( (f=fopen(filename,"w")) == NULL )
{
- screen_status_printf("Error: %s - %s", filename, strerror(errno));
+ screen_status_printf(_("Error: %s - %s"), filename, strerror(errno));
beep();
g_free(filename);
return -1;
}
if( write_key_bindings(f) )
- screen_status_printf("Error: %s - %s", filename, strerror(errno));
+ screen_status_printf(_("Error: %s - %s"), filename, strerror(errno));
else
- screen_status_printf("Wrote %s", filename);
+ screen_status_printf(_("Wrote %s"), filename);
g_free(filename);
return fclose(f);
@@ -131,7 +132,7 @@ delete_key(int cmd_index, int key_index)
{
int i = key_index+1;
- screen_status_printf("Delete...");
+ screen_status_printf(_("Deleted"));
while( i<MAX_COMMAND_KEYS && cmds[cmd_index].keys[i] )
cmds[cmd_index].keys[key_index++] = cmds[cmd_index].keys[i++];
cmds[cmd_index].keys[key_index] = 0;
@@ -148,26 +149,27 @@ assign_new_key(WINDOW *w, int cmd_index, int key_index)
char buf[BUFSIZE];
command_t cmd;
- snprintf(buf, BUFSIZE, "Enter new key for %s: ", cmds[cmd_index].name);
+ snprintf(buf, BUFSIZE, _("Enter new key for %s: "), cmds[cmd_index].name);
key = screen_getch(w, buf);
if( key==KEY_RESIZE )
screen_resize();
if( key==ERR )
{
- screen_status_printf("Aborted!");
+ screen_status_printf(_("Aborted!"));
return;
}
cmd = find_key_command(key, cmds);
if( cmd!=CMD_NONE && cmd!= cmds[cmd_index].command )
{
- screen_status_printf("Error: key %s is already used for %s",
+ screen_status_printf(_("Error: key %s is already used for %s"),
key2str(key),
get_key_command_name(cmd));
beep();
return;
}
cmds[cmd_index].keys[key_index] = key;
- screen_status_printf("Assigned %s to %s", key2str(key),cmds[cmd_index].name);
+ screen_status_printf(_("Assigned %s to %s"),
+ key2str(key),cmds[cmd_index].name);
check_subcmd_length();
lw->repaint = 1;
}
@@ -202,7 +204,7 @@ list_callback(int index, int *highlight, void *data)
}
else if ( index==subcmd_addpos )
{
- snprintf(buf, BUFSIZE, "%d. Add new key ", index+1 );
+ snprintf(buf, BUFSIZE, _("%d. Add new key "), index+1 );
return buf;
}
}
@@ -249,7 +251,7 @@ keydef_open(screen_t *screen, mpd_client_t *c)
cmds = g_malloc0(cmds_size);
memcpy(cmds, current_cmds, cmds_size);
command_list_length += STATIC_ITEMS;
- screen_status_printf("Welcome to the key editor!");
+ screen_status_printf(_("Welcome to the key editor!"));
}
subcmd = -1;
@@ -265,7 +267,7 @@ keydef_close(void)
cmds = NULL;
}
else
- screen_status_printf("Note: Did you forget to \'Apply\' your changes?");
+ screen_status_printf(_("Note: Did you forget to \'Apply\' your changes?"));
}
static char *
@@ -274,10 +276,10 @@ keydef_title(void)
static char buf[BUFSIZE];
if( subcmd<0 )
- return (TOP_HEADER_PREFIX "Edit key bindings");
+ return _(TOP_HEADER_PREFIX "Edit key bindings");
snprintf(buf, BUFSIZE,
- TOP_HEADER_PREFIX "Edit keys for %s",
+ _(TOP_HEADER_PREFIX "Edit keys for %s"),
cmds[subcmd].name);
return buf;
}
diff --git a/src/screen_play.c b/src/screen_play.c
index cdec4f77e..b4ff58cbe 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -22,6 +22,7 @@
#include <ncurses.h>
#include "config.h"
+#include "ncmpc.h"
#include "options.h"
#include "support.h"
#include "libmpdclient.h"
@@ -32,12 +33,6 @@
#include "screen_file.h"
#include "screen_play.h"
-#ifdef DEBUG
-#define D(x) x
-#else
-#define D(x)
-#endif
-
#define BUFSIZE 256
static list_window_t *lw = NULL;
@@ -93,7 +88,7 @@ handle_save_playlist(screen_t *screen, mpd_client_t *c)
{
char *filename, *filename_utf8;
- filename=screen_getstr(screen->status_window.w, "Save playlist as: ");
+ filename=screen_getstr(screen->status_window.w, _("Save playlist as: "));
filename=trim(filename);
if( filename==NULL || filename[0]=='\0' )
return -1;
@@ -113,13 +108,14 @@ handle_save_playlist(screen_t *screen, mpd_client_t *c)
g_free(str);
}
else
- screen_status_printf("Error: Unable to save playlist as %s", filename);
+ screen_status_printf(_("Error: Unable to save playlist as %s"),
+ filename);
mpd_clearError(c->connection);
beep();
return -1;
}
/* success */
- screen_status_printf("Saved %s", filename);
+ screen_status_printf(_("Saved %s"), filename);
g_free(filename);
/* update the file list if it has been initalized */
if( c->filelist )
@@ -155,7 +151,7 @@ play_exit(void)
static char *
play_title(void)
{
- return (TOP_HEADER_PREFIX "Playlist");
+ return _(TOP_HEADER_PREFIX "Playlist");
}
static void
@@ -340,7 +336,7 @@ playlist_delete_song(mpd_client_t *c, int index)
return -1;
/* print a status message */
- screen_status_printf("Removed \'%s\' from playlist!",
+ screen_status_printf(_("Removed \'%s\' from playlist!"),
mpc_get_song_name(song));
/* clear selected highlight in the browse screen */
file_set_highlight(c, song, 0);
diff --git a/src/screen_utils.c b/src/screen_utils.c
index f8dfa4c1d..080b118b1 100644
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
@@ -23,6 +23,7 @@
#include <ncurses.h>
#include "config.h"
+#include "ncmpc.h"
#include "libmpdclient.h"
#include "mpc.h"
#include "support.h"
@@ -32,8 +33,8 @@
#include "colors.h"
#include "screen.h"
-#define FIND_PROMPT "Find: "
-#define RFIND_PROMPT "Find backward: "
+#define FIND_PROMPT _("Find: ")
+#define RFIND_PROMPT _("Find backward: ")
int
screen_getch(WINDOW *w, char *prompt)
@@ -140,7 +141,7 @@ screen_find(screen_t *screen,
}
else
{
- screen_status_printf("Unable to find \'%s\'", screen->findbuf);
+ screen_status_printf(_("Unable to find \'%s\'"), screen->findbuf);
beep();
}
return 1;
diff --git a/src/support.c b/src/support.c
index d292e8462..8cb4ecafd 100644
--- a/src/support.c
+++ b/src/support.c
@@ -23,18 +23,13 @@
#include <glib.h>
#include "config.h"
+#include "ncmpc.h"
#include "support.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
-#ifdef DEBUG
-#define D(x) x
-#else
-#define D(x)
-#endif
-
#define BUFSIZE 1024
extern void screen_status_printf(char *format, ...);
@@ -174,7 +169,7 @@ utf8_to_locale(char *utf8str)
&error);
if( error )
{
- screen_status_printf("Error: Unable to convert characters to %s",
+ screen_status_printf(_("Error: Unable to convert characters to %s"),
charset);
D(g_printerr("utf8_to_locale(): %s\n", error->message));
g_error_free(error);
@@ -203,7 +198,7 @@ locale_to_utf8(char *localestr)
&error);
if( error )
{
- screen_status_printf("Error: Unable to convert characters to UTF-8");
+ screen_status_printf(_("Error: Unable to convert characters to UTF-8"));
D(g_printerr("locale_to_utf8: %s\n", error->message));
g_error_free(error);
return g_strdup(localestr);