TranslationHelper.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <Source/Translation/TranslationBus.h>
  10. #include <ScriptCanvas/Data/Data.h>
  11. namespace ScriptCanvasEditor
  12. {
  13. namespace TranslationHelper
  14. {
  15. namespace GlobalKeys
  16. {
  17. static constexpr const char* EBusSenderIDKey = "Globals.EBusSenderBusId";
  18. static constexpr const char* EBusHandlerIDKey = "Globals.EBusHandlerBusId";
  19. static constexpr const char* MissingFunctionKey = "Globals.MissingFunction";
  20. static constexpr const char* EBusHandlerOutSlot = "Globals.EBusHandler.OutSlot";
  21. } // namespace GlobalKeys
  22. namespace AssetContext
  23. {
  24. static constexpr char AZEventContext[] = "AZEventHandler";
  25. static constexpr char BehaviorClassContext[] = "BehaviorClass";
  26. static constexpr char BehaviorGlobalMethodContext[] = "BehaviorMethod";
  27. static constexpr char BehaviorGlobalPropertyContext[] = "Constant";
  28. static constexpr char CustomNodeContext[] = "ScriptCanvas::Node";
  29. static constexpr char EBusHandlerContext[] = "EBusHandler";
  30. static constexpr char EBusSenderContext[] = "EBusSender";
  31. } // namespace AssetContext
  32. namespace AssetPath
  33. {
  34. static constexpr char AZEventPath[] = "AZEvents";
  35. static constexpr char BehaviorClassPath[] = "Classes";
  36. static constexpr char BehaviorGlobalMethodPath[] = "GlobalMethods";
  37. static constexpr char BehaviorGlobalPropertyPath[] = "Properties";
  38. static constexpr char CustomNodePath[] = "Nodes";
  39. static constexpr char EBusHandlerPath[] = "EBus\\Handlers";
  40. static constexpr char EBusSenderPath[] = "EBus\\Senders";
  41. } // namespace AssetPath
  42. AZStd::string SanitizeText(const AZStd::string& text);
  43. AZStd::string SanitizeCustomNodeFileName(const AZStd::string& nodeName, const AZ::Uuid& nodeUuid);
  44. AZStd::string GetSafeTypeName(ScriptCanvas::Data::Type dataType);
  45. //! Utility function to get the path to the specified gem asset folder
  46. AZ::IO::Path GetGemAssetPath(const AZStd::string& gemName);
  47. //! Utility function to get translation file default folder path
  48. AZ::IO::Path GetTranslationDefaultFolderPath();
  49. //! Utility function to look for translation file path based on file name
  50. AZ::IO::Path GetTranslationFilePath(const AZStd::string& fileName);
  51. }
  52. }