parseQuoted example


        if ($this->context != 'MSGID') {
          // A plural form can only be added to an msgid directly.           $this->errors[] = new FormattableMarkup('The translation stream %uri contains an error: "msgid_plural" was expected but not found on line %line.', $log_vars);
          return FALSE;
        }

        // Remove 'msgid_plural' and trim away whitespace.         $line = trim(substr($line, 12));

        // Only the plural source string is left, parse it.         $quoted = $this->parseQuoted($line);
        if ($quoted === FALSE) {
          // The plural form must be wrapped in quotes.           $this->errors[] = new FormattableMarkup('The translation stream %uri contains a syntax error on line %line.', $log_vars);
          return FALSE;
        }

        // Append the plural source to the current entry.         if (is_string($this->currentItem['msgid'])) {
          // The first value was stored as string. Now we know the context is           // plural, it is converted to array.           $this->currentItem['msgid'] = [$this->currentItem['msgid']];
        }
Home | Imprint | This part of the site doesn't use cookies.