// =========================================================================== // 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: Jul 11 2005 // // Description: // Since localizable MEL resources are now accessed // through "uiRes( keyID )", we use initResources() to // initialize the language-appropriate string values // associated with each keyID. // // First, we source the default (English) version of // the resource script. (This lets us create a // baseline that we can always fall back to.) In case // a localized, non-English resource script is missing // a required key-value pair (or the file is missing // altogether!) we can at least display the English // default value instead of bailing on the generation // of the UI or not knowing how to display the missing, // non-English text. // global proc initResources( string $file ) { global string $gResourceFileList[] = {}; // If we've already processed this file, don't re-source it. // if( stringArrayCount( $file, $gResourceFileList ) == 0 ) { // Create English baseline. This must be found or we're in // big trouble. // eval( "source \"" + $file + "\"" ); // Keep track of processed files so we don't source them // twice. // $gResourceFileList[ size($gResourceFileList) ] = $file; // When language preference set to anything but English, // source the localized resource script to layer the new // resource definitions on top of the existing English baseline. // string $languagePath = languageResourcePath( $file ); if(( $languagePath != $file ) && ( $languagePath != "" )) { eval( "source \"" + $languagePath + "\"" ); } } }