// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // May, 2016 // // Description: // This script defines the procedure for getting the english name // from the localized UI Component name // // // Procedure Name: // unLocalizedUIComponentLabel // // Description: // Returns the unlocalized UI Component label. // // Input Arguments: // Localized version of the UI component. // // Return Value: // English version of the UI component. // global proc string unLocalizedUIComponentLabel(string $localizedLabel) { if( !`exists localizedUIComponentLabel` ) { source localizedUIComponentLabel; } string $LabelEn; int $foundIt = false; string $uiComponentlabels[] = localizedUIComponentLabels(); int $i, $count = size( $uiComponentlabels ); for( $i = 1; $i < $count; $i+=2 ) { if( $localizedLabel == $uiComponentlabels[$i] ) { // get english name $LabelEn = $uiComponentlabels[$i-1]; $foundIt = true; break; } } // If we couldn't find a match, just return what was // passed in. // if( !$foundIt ) { uiToMelMsg( "UIComponents_uiToMel", $localizedLabel, 0 ); $LabelEn = $localizedLabel; } return $LabelEn; }