Skip to content

Commit

Permalink
translations: translate C++ std::strings
Browse files Browse the repository at this point in the history
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 4bcb226
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/translations.h
Expand Up @@ -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 );

Expand Down

0 comments on commit 4bcb226

Please sign in to comment.