catalog lookup broken in 2.8.5

personaje personaje at gmail.com
Wed Oct 3 14:16:39 PDT 2007


Hello,

   I recently ported a wx2.6.4 application to use 2.8.5 and found that
I no longer got translations. The problem comes from :

---------------8<---------------8<---------------8<---------------8<---------------8<---------------8<---------------
wxString GetMsgCatalogSubdirs(const wxChar *prefix, const wxChar *lang)
{
    wxString searchPath;
    searchPath << prefix << wxFILE_SEP_PATH << lang;

    // Under Unix, the message catalogs are supposed to go into LC_MESSAGES
    // subdirectory so look there too. Note that we do it on all platforms
    // and not just Unix, because it doesn't cost much to look into one more
    // directory and doing it this way has two important benefits:
    // a) we don't break compatibility with wx-2.6 and older by stopping to
    //    look in a directory where the catalogs used to be and thus silently
    //    breaking apps after they are recompiled against the latest wx
    // b) it makes it possible to package app's support files in the same
    //    way on all target platforms
    const wxString searchPathOrig(searchPath);
    searchPath << wxFILE_SEP_PATH << wxT("LC_MESSAGES")
               << wxPATH_SEP << searchPathOrig;

    return searchPath;
}
---------------8<---------------8<---------------8<---------------8<---------------8<---------------8<---------------

A line before return shoud be added:

---------------8<---------------8<---------------8<---------------8<---------------8<---------------8<---------------

    searchPath << wxFILE_SEP_PATH << prefix;

---------------8<---------------8<---------------8<---------------8<---------------8<---------------8<---------------

so that catalogs are searched on the added prefix (as noted in the
documentation) and performed by the wx2.6.4 intl.cpp:function
GetAllMsgCatalogSubdirs()

Regards.




More information about the wx-users mailing list