Address bugs #19816 and #18959.

    #19816: localization fails if translations contain unused internalnames
    #18959: failed tests