Permalink
Browse files

translations: translate C++ std::strings

Overload _() to take std::strings instead of requiring everyone to
pass .c_str().
  • Loading branch information...
mlangsdorf committed Jan 2, 2019
1 parent ae8e456 commit 4bcb226ffd778bff94cdf6c190bc7e4932412efa
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/translations.h
@@ -46,6 +46,11 @@ inline const char *_( const char *msg )
{
return ( msg[0] == '\0' ) ? msg : gettext( msg );
}
const char *_( const std::string &msg );
inline const char *_( const std::string &msg )
{
return _( msg.c_str() );
}

const char *pgettext( const char *context, const char *msgid ) ATTRIBUTE_FORMAT_ARG( 2 );

0 comments on commit 4bcb226

Please sign in to comment.