docs: def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
          """A helper method to register a rule (and optionally a view function)
          to the application.  The endpoint is automatically prefixed with the
          blueprint's name.
          The URL rule is registered twice.
          """
          # Static assets are not localized
          if endpoint == 'static':
              return super(I18nBlueprintSetupState, self).add_url_rule(
                  rule, endpoint=endpoint, view_func=view_func, **options)
          if self.url_prefix:
              rule = self.url_prefix + rule
          options.setdefault('subdomain', self.subdomain)
          if endpoint is None:
              endpoint = _endpoint_from_view_func(view_func)
          defaults = self.url_defaults
          if 'defaults' in options:
              defaults = dict(defaults, **options.pop('defaults'))
          # Handle an optional cors=True parameter
          options.setdefault('cors', False)
          if options.pop('cors', False):
              methods = options.get('methods', ['GET'])
              if 'HEAD' not in methods:
                  methods.append('HEAD')
              if 'OPTIONS' not in methods:
                  methods.append('OPTIONS')
              decorator = cors.crossdomain('*', headers='*', credentials=True)
              view_func = decorator(view_func)
              options['methods'] = methods
  
          if options.pop('localize', True):
              self.app.add_url_rule('/<lang:lang_code>' + rule,
                                    '%s.%s' % (self.blueprint.name, endpoint),
                                    view_func, defaults=defaults, **options)
  
              self.app.add_url_rule(
                  rule, '%s.%s_redirect' % (self.blueprint.name, endpoint),
                  redirect_to_lang, defaults=defaults, **options)
          else:
              self.app.add_url_rule(rule,
                                    '%s.%s' % (self.blueprint.name, endpoint),
                                    view_func, defaults=defaults, **options)
  
              self.app.add_url_rule(
                  '/<lang:lang_code>' + rule,
                  '%s.%s_redirect' % (self.blueprint.name, endpoint),
                  redirect_to_unlocalized, defaults=defaults, **options)