Skip to content

Commit

Permalink
EMSUSD-1504 add back missing MayaUSD localization
Browse files Browse the repository at this point in the history
The MEl version of localized strings for MayaUSdLib was lost. It is only used in the "Add Maya Reference" dialog and was not noticed during testing.
  • Loading branch information
pierrebai-adsk committed Oct 15, 2024
1 parent 068062f commit a2a8207
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/mayaUsd/resources/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
list(APPEND scripts_src
mayaUsdLibRegisterStrings.mel
mayaUsdLibRegisterStrings.py
mayaUsdAddMayaReference.mel
mayaUsdAddMayaReference.py
Expand Down
20 changes: 20 additions & 0 deletions lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.mel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2022 Autodesk
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

global proc string getMayaUsdLibString(string $key)
{
return getPluginResource("mayaUsdLib", $key);
}

5 changes: 1 addition & 4 deletions lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ def registerPluginResource(pluginId, stringId, resourceStr):
'''See registerPluginResource.mel in Maya.
Unfortunately there is no equivalent python version of this MEL proc
so we created our own version of it here.
We also re-implement it here because we don't want warnings when registering
the same string again, which happens when re-loading the plugin.'''
so we created our own version of it here.'''

fullId = 'p_%s.%s' % (pluginId, stringId)
if cmds.displayString(fullId, exists=True):
Expand Down
1 change: 1 addition & 0 deletions plugin/adsk/scripts/mayaUSDRegisterStrings.mel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ global proc mayaUSDRegisterStrings()
python("import mayaUSDRegisterStrings; mayaUSDRegisterStrings.mayaUSDRegisterStrings()");

// Register the strings from the MayaUsd Lib.
source "mayaUSDLibRegisterStrings.mel";
python("import mayaUsdLibRegisterStrings; mayaUsdLibRegisterStrings.mayaUsdLibRegisterStrings()");

// load any localized resources
Expand Down

0 comments on commit a2a8207

Please sign in to comment.