Skip to content

Treat IDREF mismatches as warnings in non-English translations#303

Open
jordikroon wants to merge 1 commit into
php:masterfrom
jordikroon:idref-as-warnings
Open

Treat IDREF mismatches as warnings in non-English translations#303
jordikroon wants to merge 1 commit into
php:masterfrom
jordikroon:idref-as-warnings

Conversation

@jordikroon

@jordikroon jordikroon commented Jun 17, 2026

Copy link
Copy Markdown
Member

For non-English translations, IDREF mismatches should be treated as warnings instead of errors.
Outdated translations may reference IDs that have yet to be translated from doc-en, thus results in a CI failure.

@jordikroon jordikroon requested a review from alfsb June 17, 2026 18:47
@alfsb

alfsb commented Jun 17, 2026

Copy link
Copy Markdown
Member

You can probably only count the lines that preg_match the message considered a warning. If the matched line count equals the output line count, then all lines are warned instead of errors, on translations.

    if ( ! is_array( $out ) )
        $out = [];
       
    $warnCount = 0;
    foreach ( $out as $line )
        if ( preg_match( $regex , $line ) )
            $warnCount++;
               
    $fatal = ( $isEnglish && count( $out ) > 0 ) || count( $out ) != $warnCount;

Let the errors be outputted as is. There is no point sileting warnings of real problems. There are other parts of configure.php that show warnings and do not abort the build as an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants