﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
11379,"Getting ""Warning: Cannot modify header information - headers already sent by (output started at..."" because of locale plugins",waclawjacek,nbachiyski,"I've written a plugin (to be put as wp-content/languages/pl_PL.php) providing additional localized features for the Polish translation of WordPress as I get ""Warning: Cannot modify header information - headers already sent by (output started at..."" on pages dealing with sessions (the reason is the filter). Here's the code:

{{{
<?php

/* wp-config.php modifications */
$wp_default_secret_key = 'wprowadz tutaj unikatowa fraze';

/* filters */
add_filter( 'date_i18n', 'date_declension' );

/* functions */
function date_declension( $date )
{

        $month_names = array( '%Styczeń%', '%Luty%', '%Marzec%', '%Kwiecień%', '%Maj%', '%Czerwiec%', '%Lipiec%', '%Sierpień%', '%Wrzesień%', '%Październik%', '%Listopad%', '%Grudzień%' );
        $month_names_genitive = array( 'stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia' );
        $month_names_locative = array( 'styczniu', 'lutym', 'marcu', 'kwietniu', 'maju', 'czerwcu', 'lipcu', 'sierpniu', 'wrześniu', 'październiku', 'listopadzie', 'grudniu' );

        /* ""1 Styczeń..."" -> ""1 stycznia..."" */
        $pattern = '%^\d{1,2}\ \w+%';
        if ( preg_match( $pattern, $date ) == 1 ) return preg_replace( $month_names, $month_names_genitive, $date );

        return $date;
}

?>

}}}
",defect (bug),closed,normal,,I18N,2.8.6,major,invalid,,
