code: @Nullable
    private static String getLocalVarTranslation(String ident, SoyToJsVariableMappings mappings) {
      Expression translation = mappings.maybeGet(ident);
      if (translation == null) {
        return null;
      }
      JsExpr asExpr = translation.assertExpr();
      return asExpr.getPrecedence() != Integer.MAX_VALUE
          ? "(" + asExpr.getText() + ")"
          : asExpr.getText();
    }
docs: Gets the translated expression for an in-scope local variable (or special "variable" derived
  from a foreach-loop var), or null if not found.
  
  @param ident The Soy local variable to translate.
  @param mappings The replacement JS expressions for the local variables (and foreach-loop
  special functions) current in scope.
  @return The translated string for the given variable, or null if not found.