[mapguide-dev] GetLocalizedString

Walt Welton-Lair walt.welton-lair at autodesk.com
Wed Nov 15 20:37:08 EST 2006


It's a static helper method used to look up a localized string by name
(name="DISTANCEMETERS" in this case).  The source for the method (not
particularly interesting) is in the file PhpLocalizer.cpp in this
folder:
 
https://mapguide.osgeo.org/source/browse/mapguide/trunk/MgDev/Web/src/Ph
pApi/
 
The localized strings are stored in resource files, and the locale
argument specifies which file to use.  In the open source vault the
resource files are located in this folder:
 
https://mapguide.osgeo.org/source/browse/mapguide/trunk/MgDev/Web/src/lo
calized/.
 
Don't know offhand where the web tier install actually puts them - look
for a "localized" folder.
 
The vault only contains the English resource file, named "en".  Using
that locale, the returned string in this example would be "Meters".  The
coordinate system doesn't come into play.
 
Walt
 
  _____  

From: Scott Hameister [mailto:ScottH at mPower-tech.com] 
Sent: Thursday, November 16, 2006 2:01 AM
To: dev at mapguide.osgeo.org
Subject: [mapguide-dev] GetLocalizedString



Looking at the Last line of the Selected Code         "$unitsType =
GetLocalizedString("DISTANCEMETERS", $locale);"

What is happening here??? Im not a PHP programmer and I cant find a
function Called GetLocalizedString anywhere....

...What would this be in a Map with no Coordsys? Or is that Irrelevant?

 

 

 

//get the map extent and calculate the scale factor

        //

        $mapExtent = $map->GetMapExtent();

        $srs = $map->GetMapSRS();

        if($srs != "")

        {

            $csFactory = new MgCoordinateSystemFactory();

            $cs = $csFactory->Create($srs);

            $metersPerUnit =
$cs->ConvertCoordinateSystemUnitsToMeters(1.0);

            $unitsType = $cs->GetUnits();

        }

        else

        {

            $metersPerUnit = 1.0;

            $unitsType = GetLocalizedString("DISTANCEMETERS", $locale);

        }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20061115/6cae56aa/attachment.html


More information about the Mapguide-internals mailing list