cleanup resourcestring element names

Issue #37 resolved
MJordan created an issue

Hi,

I’m using the Better Translation Manager together with C++Builder 11. The element names of the ressourcestrings are accompanied by superfluous characters.

Example:

unit UnitName;
resourcestring ResourceStringName = 'Hello';

becomes: _ZN8Unitname19_ResourceStringNameE

I don’t know the meaning of the heading “_ZN” and the tailing “E”. It would be nice to hide them.

The digits seem to number the characters of the subsequent part. They are interfering with alphabetical sorting and should be hidden as well.

Thanks a lot.

Comments (8)

  1. Anders@Melander

    Would you mind attaching a sample of a C++ Builder produced DRC-file to the issue so I can see what it looks like?

    The names in Delphi DRC-files don’t have these extra characters. For example, with Delphi the name would have become UnitNameResourceStringName.
    I actually like the C++ Builder naming better since it seems it will enable me to split the names into unit/name pairs. That isn't really possible with Delphi since I can't realiably tell if UnitNameResourceStringName means UnitName/ResourceStringName or UnitNameResource/StringName etc.

  2. MJordan reporter

    I’ve created a simple test project containing 3 resourcestrings in 2 units.

    The resulting DRC-file is this:

    /*
      Generated by the CodeGear C++ Incremental Linker
      because -GD was supplied to the linker.
    
      It contains compiler-generated resource bound to the executable.
      If it is empty, no compiler-generated resources were bound to the
      produced executable.
    */
    
    #define _ZN10Mytestunit15_FormatDistanceE 65520
    #define _ZN7Myworld16_MsgAlertCaptionE 65521
    #define _ZN7Myworld13_MsgAlertTextE 65522
    STRINGTABLE
    BEGIN
        _ZN10Mytestunit15_FormatDistanceE,  "%.1f cm"
        _ZN7Myworld16_MsgAlertCaptionE, "Alert"
        _ZN7Myworld13_MsgAlertTextE,    "Shout Hello to the World!"
    END
    

    I don’t know hot to attach the sources to this post.

  3. MJordan reporter

    If I’m doing a static link to the the runtime, I get hundreds of internal strings in nested namespaces (e.g.):

    #define _ZN3Vcl7Comstrs17_sInvalidComCtl32E 65040
    #define _ZN3Vcl7Comstrs13_sDateTimeMaxE 65041
    #define _ZN3Vcl7Comstrs13_sDateTimeMinE 65042
    #define _ZN3Vcl7Comstrs15_sNeedAllowNoneE 65043
    ...
    #define _ZN6System9Netconsts29_SBluetoothWisockCleanupErrorE 65216
    #define _ZN6System9Netconsts26_SBluetoothSetSockOptErrorE 65217
    #define _ZN6System9Netconsts28_SBluetoothClientsocketErrorE 65218
    #define _ZN6System9Netconsts29_SBluetoothClientConnectErrorE 65219
    ...
    #define _ZN6System9Rtlconsts25_SThreadExternalTerminateE 65363
    #define _ZN6System9Rtlconsts20_SThreadExternalWaitE 65364
    #define _ZN6System9Rtlconsts18_SThreadStartErrorE 65365
    #define _ZN6System9Rtlconsts31_SThreadExternalCheckTerminatedE 65366
    

  4. Anders@Melander

    I have uploaded a new build (v2.0.8370.39904) that should be able to handle the C++ mangled names.

    When you load your project and do an update the old names will be marked as “unused” and the new ones as “added”. You will then be prompted to recover unused translations. If you choose to do this any existing resourcstring translations should be recovered without problems. The old resourcestring names can be removed by doing a Purge.

  5. Log in to comment