code: protected void writeBundle(PrintWriter writer, String name, ResourceBundle bundle) {
  
      writer.print("var ");
      writer.print(escapeBundleName(name));
      writer.println(" = {");
      Enumeration<String> keyEnum = bundle.getKeys();
      while (keyEnum.hasMoreElements()) {
        String key = keyEnum.nextElement();
        Object object = bundle.getObject(key);
        if (object instanceof String) {
          writer.print(escapeBundleKey(key));
          writer.print(":\"");
          writer.print(object.toString());
          writer.print("\",");
        }
      }
      writer.println("};");
    }
docs: This method writes the given {@link ResourceBundle} to the {@code writer}.
  
  @param writer is the {@link PrintWriter} to use.
  @param name is the {@link ResourceBundle#getBundle(String) bundle name}.
  @param bundle is the {@link ResourceBundle} for the users locale to write to the given {@code writer}.