Changeset 5f2dd73ec8e68b0191d251ec80dc220b70624719
- Timestamp:
- 22/05/08 21:46:11
(5 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1211485571 +0300
- git-parent:
[a6ab35eee2d88fda9c3e0397504547f01c88bf5a]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1211485571 +0300
- Message:
Provide vlc_gettext on all platforms
This avoids having to link a few plugins with libintl on platforms where
it's not built-in libc. This also factors the internal use of
dgettext("vlc", ...).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra6ab35e |
r5f2dd73 |
|
| 890 | 890 | *****************************************************************************/ |
|---|
| 891 | 891 | #ifdef WIN32 |
|---|
| 892 | | VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); |
|---|
| 893 | | #endif |
|---|
| | 892 | VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); |
|---|
| | 893 | #endif |
|---|
| | 894 | VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) ); |
|---|
| 894 | 895 | |
|---|
| 895 | 896 | /***************************************************************************** |
|---|
| ra6ab35e |
r5f2dd73 |
|
| 164 | 164 | |
|---|
| 165 | 165 | /* libintl support */ |
|---|
| 166 | | #define _(str) dgettext (PACKAGE_NAME, str) |
|---|
| | 166 | #define _(str) vlc_gettext (str) |
|---|
| 167 | 167 | |
|---|
| 168 | 168 | #if defined (ENABLE_NLS) |
|---|
| 169 | 169 | # include <libintl.h> |
|---|
| 170 | | # ifdef WIN32 |
|---|
| 171 | | # undef _ |
|---|
| 172 | | # define _(str) vlc_dgettext (PACKAGE_NAME, str) |
|---|
| 173 | | # endif |
|---|
| 174 | 170 | #else |
|---|
| 175 | | # define dgettext(dom, str) (str) |
|---|
| | 171 | # define dgettext(dom, str) ((char *)(str)) |
|---|
| 176 | 172 | #endif |
|---|
| 177 | 173 | |
|---|
| rd1d3dc1 |
r5f2dd73 |
|
| 608 | 608 | #endif |
|---|
| 609 | 609 | |
|---|
| 610 | | #ifdef WIN32 |
|---|
| 611 | | /***************************************************************************** |
|---|
| 612 | | * dgettext: gettext for plugins. |
|---|
| 613 | | *****************************************************************************/ |
|---|
| | 610 | #if defined (WIN32) |
|---|
| | 611 | /** |
|---|
| | 612 | * gettext callbacks for plugins. |
|---|
| | 613 | * LibVLC links libintl statically on Windows. |
|---|
| | 614 | */ |
|---|
| 614 | 615 | char *vlc_dgettext( const char *package, const char *msgid ) |
|---|
| 615 | 616 | { |
|---|
| 616 | | #if defined( ENABLE_NLS ) \ |
|---|
| 617 | | && ( defined(HAVE_GETTEXT) || defined(HAVE_INCLUDED_GETTEXT) ) |
|---|
| 618 | 617 | return dgettext( package, msgid ); |
|---|
| 619 | | #else |
|---|
| 620 | | return (char *)msgid; |
|---|
| 621 | | #endif |
|---|
| 622 | | } |
|---|
| 623 | | #endif |
|---|
| | 618 | } |
|---|
| | 619 | #endif |
|---|
| | 620 | |
|---|
| | 621 | /** |
|---|
| | 622 | * In-tree plugins share their gettext domain with LibVLC. |
|---|
| | 623 | */ |
|---|
| | 624 | char *vlc_gettext( const char *msgid ) |
|---|
| | 625 | { |
|---|
| | 626 | return dgettext( PACKAGE_NAME, msgid ); |
|---|
| | 627 | } |
|---|
| 624 | 628 | |
|---|
| 625 | 629 | /***************************************************************************** |
|---|
| r59dec65 |
r5f2dd73 |
|
| 405 | 405 | vlc_getenv |
|---|
| 406 | 406 | vlc_getnameinfo |
|---|
| | 407 | vlc_gettext |
|---|
| 407 | 408 | vlc_iconv |
|---|
| 408 | 409 | vlc_iconv_close |
|---|