1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 15:23:48 +01:00

Move definition of _ and related into Internat.h

This commit is contained in:
Paul Licameli
2017-09-25 14:07:23 -04:00
parent e37d701bc0
commit c6696f1b49
52 changed files with 89 additions and 53 deletions

View File

@@ -16,6 +16,41 @@
#include <wx/string.h>
#include <wx/longlong.h>
#ifndef IN_RC
class wxString;
extern const wxString& GetCustomTranslation(const wxString& str1 );
extern const wxString& GetCustomSubstitution(const wxString& str1 );
// Marks string for substitution only.
#define _TS( s ) GetCustomSubstitution( s )
// Marks strings for extraction only...must use wxGetTranslation() to translate.
#define XO(s) wxT(s)
#define _(s) GetCustomTranslation((s))
// The two string arugments will go to the .pot file, as
// msgid sing
// msgid_plural plural
//
// (You must use plain string literals. Do not use _() or wxT() or L prefix,
// which (intentionally) will fail to compile. The macro inserts wxT).
//
// Note too: it seems an i18n-hint comment is not extracted if it precedes
// wxPLURAL directly. A workaround: after the comment, insert a line
// _("dummyStringXXXX");
// where for XXXX subsitute something making this dummy string unique in the
// program. Then check in your generated audacity.pot that the dummy is
// immediately before the singular/plural entry.
//
// Your i18n-comment should therefore say something like,
// "In the string after this one, ..."
#define wxPLURAL(sing, plur, n) wxGetTranslation( wxT(sing), wxT(plur), n)
#endif
class Internat
{
public: