public static String translateLogicalPathname(String pathname) {
    if (!(Stella.logicalPathnameP(pathname))) {
      return (pathname);
    }
    { String host = Stella.getLogicalHostName(pathname);
      String translatedpathname = pathname;

      translatedpathname = Native.string_substitute(Stella.logicalPathnameWithoutHost(pathname), Stella.directorySeparator(), Stella.LOGICAL_DIRECTORY_SEPARATOR);
      { StringWrapper rootdirectory = ((StringWrapper)(Stella.lookupLogicalHostProperty(host, Stella.KWD_ROOT_DIRECTORY)));

        if (rootdirectory != null) {
          if (Stella.absolutePathnameP(translatedpathname)) {
            translatedpathname = Native.string_subsequence(translatedpathname, 1, Stella.NULL_INTEGER);
          }
          translatedpathname = rootdirectory.wrapperValue + translatedpathname;
        }
      }
      return (translatedpathname);
    }
  }