// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Oct 09, 2006 // // Description: // This script defines the procedure for getting the EN name // from the localized panel name // // // Procedure Name: // unlocalizedPanelLabel // // Description: // Returns the unlocalized panel label. // // Input Arguments: // The localized version of the panel label. // // Return Value: // The English version of the panel label. // global proc string unlocalizedPanelLabel(string $localized) { string $panelLabel; if( !`exists localizedPanelLabels` || !`exists labelBaseAndSuffix` ) { source localizedPanelLabel; } string $results[] = `labelBaseAndSuffix $localized`; string $baseLabel = $results[0]; string $suffix = $results[1]; int $foundIt = false; string $labels[] = localizedPanelLabels(); int $i, $count = size( $labels ); for( $i = 1; $i < $count; $i+=2 ) { if( $baseLabel == $labels[$i] ) { $panelLabel = $labels[$i-1]; $foundIt = true; break; } } // If the panel name had a suffix, add it back now. // if( size( $suffix ) ) { $panelLabel += $suffix; } // If we couldn't find a match, just return what was // passed in. // if( !$foundIt ) { $panelLabel = $localized; uiToMelMsg( "unlocalizedPanelLabel", $localized, 0 ); } return $panelLabel; }