VirtualBox

Changeset 91392 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Sep 27, 2021 12:33:40 PM (3 years ago)
Author:
vboxsync
Message:

Main/NLS: VirtualBoxTranslator::i_translate should not safe the passed in source string as there is no guarantee that it is immutable. So, make the translator return a safe source string copy iff it returns a translated string. bugref:1909

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/QMTranslator.h

    r90828 r91392  
    3333     * Gets translation from loaded QM file
    3434     *
    35      * @param   pszContext  QM context to look for translation
    36      * @param   pszSource   Source string in one-byte encoding
    37      * @param   pszDisamb   Disambiguationg comment, empty by default
    38      * @param   iNum        Plural form indicator.
     35     * @param   pszContext      QM context to look for translation
     36     * @param   pszSource       Source string in one-byte encoding
     37     * @param   ppszSafeSource  Where to return pointer to a safe copy of @a
     38     *                          pszSource for the purpose of reverse translation.
     39     *                          Will be set to NULL if @a pszSource is returned.
     40     * @param   pszDisamb       Disambiguationg comment, empty by default
     41     * @param   iNum            Plural form indicator.
    3942     *
    4043     * @returns Pointer to a translation (UTF-8 encoding), source string on failure.
    4144     */
    42     const char *translate(const char *pszContext, const char *pszSource,
     45    const char *translate(const char *pszContext, const char *pszSource, const char **ppszSafeSource,
    4346                          const char *pszDisamb = NULL, const int iNum = -1) const RT_NOEXCEPT;
    4447
Note: See TracChangeset for help on using the changeset viewer.

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