Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
86c47f64
Commit
86c47f64
authored
Apr 16, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement vlc_ngettext() to deal with plurals
parent
24d5309b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
include/vlc_common.h
include/vlc_common.h
+2
-1
po/Makevars
po/Makevars
+1
-1
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/modules/textdomain.c
src/modules/textdomain.c
+11
-4
No files found.
include/vlc_common.h
View file @
86c47f64
...
...
@@ -918,7 +918,8 @@ VLC_API void * vlc_memcpy( void *, const void *, size_t );
/*****************************************************************************
* I18n stuff
*****************************************************************************/
VLC_API
char
*
vlc_gettext
(
const
char
*
msgid
)
VLC_FORMAT_ARG
(
1
);
VLC_API
char
*
vlc_gettext
(
const
char
*
msgid
)
VLC_FORMAT_ARG
(
1
);
VLC_API
char
*
vlc_ngettext
(
const
char
*
s
,
const
char
*
p
,
unsigned
long
n
)
VLC_FORMAT_ARG
(
1
)
VLC_FORMAT_ARG
(
2
);
#define vlc_pgettext( ctx, id ) \
vlc_pgettext_aux( ctx "\004" id, id )
...
...
po/Makevars
View file @
86c47f64
...
...
@@ -10,7 +10,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=_ANS --keyword=qtr --keyword=Q_ --language=C++ --keyword=vlc_pgettext:1c,2 --add-comments=xgettext: --from-code=UTF-8
XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=_ANS --keyword=qtr --keyword=Q_ --language=C++ --keyword=vlc_
ngettext:1,2 --keyword=vlc_
pgettext:1c,2 --add-comments=xgettext: --from-code=UTF-8
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
...
...
src/libvlccore.sym
View file @
86c47f64
...
...
@@ -537,6 +537,7 @@ vlc_GetActionId
vlc_getaddrinfo
vlc_getnameinfo
vlc_gettext
vlc_ngettext
vlc_hold
vlc_iconv
vlc_iconv_close
...
...
src/modules/textdomain.c
View file @
86c47f64
...
...
@@ -97,10 +97,17 @@ int vlc_bindtextdomain (const char *domain)
char
*
vlc_gettext
(
const
char
*
msgid
)
{
#ifdef ENABLE_NLS
if
(
unlikely
(
!*
msgid
))
return
(
char
*
)
""
;
return
dgettext
(
PACKAGE_NAME
,
msgid
);
#else
if
(
likely
(
*
msgid
))
return
dgettext
(
PACKAGE_NAME
,
msgid
);
#endif
return
(
char
*
)
msgid
;
}
char
*
vlc_ngettext
(
const
char
*
msgid
,
const
char
*
plural
,
unsigned
long
n
)
{
#ifdef ENABLE_NLS
if
(
likely
(
*
msgid
))
return
dngettext
(
PACKAGE_NAME
,
msgid
,
plural
,
n
);
#endif
return
(
char
*
)((
n
==
1
)
?
msgid
:
plural
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment