code: public static Printer createStandardPrinter(final Messages messages) {
          return new Printer() {
              @Override
              protected String localize(Locale locale, String key, Object... args) {
                  return messages.getLocalizedString(locale, key, args);
              }
  
              @Override
              protected String capturedVarId(CapturedType t, Locale locale) {
                  return (t.hashCode() & 0xFFFFFFFFL) % PRIME + "";
          }};
      }
docs: Create a printer with default i18n support provided by Messages. By default,
  captured types ids are generated using hashcode.
  
  @param messages Messages class to be used for i18n
  @return printer visitor instance