VirtualBox

Changeset 92533 in vbox


Ignore:
Timestamp:
Nov 21, 2021 2:18:55 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148408
Message:

VBoxManage: Document DECLARE_TRANSLATION_CONTEXT and fixed prefix mixup. bugref:1909

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r92372 r92533  
    5151////////////////////////////////////////////////////////////////////////////////
    5252
     53/**
     54 * This defines a a_CtxName::tr function that gives the translator context as
     55 * well as providing a shorter way to call VirtualBoxTranslator::translate.
     56 */
    5357#ifdef VBOX_WITH_VBOXMANAGE_NLS
    54 # define DECLARE_TRANSLATION_CONTEXT(ctx) \
    55 struct ctx \
    56 {\
    57    static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t aNum = ~(size_t)0) \
     58# define DECLARE_TRANSLATION_CONTEXT(a_CtxName) \
     59struct a_CtxName \
     60{ \
     61   static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t uNum = ~(size_t)0) \
    5862   { \
    59        return VirtualBoxTranslator::translate(NULL, #ctx, pszSource, pszComment, aNum); \
     63       return VirtualBoxTranslator::translate(NULL, #a_CtxName, pszSource, pszComment, uNum); \
    6064   } \
    6165}
    6266#else
    63 # define DECLARE_TRANSLATION_CONTEXT(ctx) \
    64 struct ctx \
    65 {\
    66    static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t aNum = ~(size_t)0) \
     67# define DECLARE_TRANSLATION_CONTEXT(a_CtxName) \
     68struct a_CtxName \
     69{ \
     70   static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t uNum = ~(size_t)0) \
    6771   { \
    68        NOREF(pszComment); \
    69        NOREF(aNum);       \
     72       RT_NOREF(pszComment, uNum); \
    7073       return pszSource;  \
    7174   } \
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette