wiki:FdoMeasureUnitLocaleSupport

FDO MeasureUnit Locale Support

Overview

As a result of integrating usage of the FDO Measure Units interfaces into Autodesk Map during the Autodesk Map 2007 development cycle, a deficiency was uncovered in the current specification of the FDO API.

The Map development team wished to display the Measure Unit names, retrieved from the Autodesk FDO Raster Provider, on their user interface. This proved to be impossible. Map requires that all strings present on its UI be externalized and it was discovered that the strings returned from the FDO MeasureUnit API were hard-coded. The MeasureUnit names were hard-coded in the Raster provider because they represented a look-up value into the Raster MeasureUnit collection. Externalizing these strings would mean that the lookup value would fail to be found if the Map drawing file was moved from one locale to another.

A solution to this problem was identified in the 2007 timeframe but was not implemented due to time constraints. In response to the inability of FDO to externalize the strings, the Autodesk Map team implemented a workaround that mapped the hard-coded FDO return values to an externalized lookup list specified in a resource catalog.

In order to resolve this issue, an FDO specific solution should be implemented that would see the FDO API updated to include a LocalizedName property on the MeasureUnit interfaces. The following sections outline how this new property will be defined.

FdoICreateMeasureUnit

The FdoICreateMeasureUnit interface will be modified as follows:

GetLocalizedName

A GetLocalizedName method will be added to the FdoICreateMeasureUnit interface

    /// \brief
    /// Gets the localized name of the measure unit to be added.
    /// 
    /// \remarks
    /// The localized name will need to be externalized in an 
    /// FDO Provider Message Catalog. This value is to be used 
    /// if the name of the measure unit is to be displyed 
    /// on a user interface.
    /// 
    /// \return
    /// Returns the localized name of the measure unit
    /// 
    FDO_API virtual FdoString* GetLocalizedName() = 0;
SetLocalizedName

A SetLocalizedName method will be added to the FdoICreateMeasureUnit interface

    /// \brief
    /// Sets the localized name of the measure unit to be added.
    /// 
    /// \param value
    /// Input The localized name of the measure unit 
    /// The localized name will need to be externalized 
    /// in an FDO Provider Message Catalog. This value is to
    /// be used if the name of the measure unit is to be displyed 
    /// on a user interface.
    /// 
    FDO_API virtual void SetLocalizedName( FdoString* value ) = 0;

FdoIMeasureUnitReader

The FdoIMeasureUnitReader interface will be modified as follows:

GetLocalizedName

A GetLocalizedName method will be added to the FdoIMeasureUnitReader interface

    /// \brief
    /// Gets the localized name of the measure unit currently being read.
    /// 
    /// \remarks
    /// The localized name will need to be externalized in an 
    /// FDO Provider Message Catalog. This value is to be used 
    /// if the name of the measure unit is to be displyed 
    /// on a user interface.
    /// 
    /// \return
    /// Returns the localized name of the measure unit
    /// 
    FDO_API virtual FdoString* GetLocalizedName() = 0;
Last modified 10 years ago Last modified on Oct 18, 2007 8:38:49 AM