Empty string causes error in GUI translations

Bug #1654837 reported by Kerusey Karyu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Unassigned

Bug Description

PoEdit report a warning of empty string:

pcbnew/dialogs/dialog_design_rules.cpp:994:
warning: Empty msgid. It is reserved by GNU gettext:
gettext("") returns the header entry with meta information, not the empty string.

Indeed. In pcbnew/dialogs/dialog_design_rules.cpp:

    // Test net class parameters.
    for( int row = 0; row < m_grid->GetNumberRows(); row++ )
    {
        netclassLabel = GetChars( m_grid->GetRowLabelValue( row ) );
        netclassError = _( "" ); // Clear the error for this netclass

        int tracksize = ValueFromString( g_UserUnit,
                                         m_grid->GetCellValue( row, GRID_TRACKSIZE ) );

BTW: In pcbnew/dialogs/dialog_design_rules.cpp:1089
        // If this netclass contains errors, add it to the error message
        if ( !netclassError.IsEmpty() )
        {
            msg.Printf( _( "Netclass: <b>%s</b><br>" ), netclassLabel );
            errorMsg += msg;
            errorMsg += netclassError;
            errorMsg += _( "<br>" );
        }

Is single <br> tag should be translatable?

description: updated
description: updated
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1654837] Re: Empty string causes error in GUI translations
Download full text (3.4 KiB)

Would you please attach these changes as a patch? Empty strings and
HTML tags shouldn't be in translated strings.

On 1/8/2017 7:02 AM, Kerusey Karyu wrote:
> ** Description changed:
>
> PoEdit report a warning of empty string:
>
> - pcbnew/dialogs/dialog_design_rules.cpp:994:
> + pcbnew/dialogs/dialog_design_rules.cpp:994:
> warning: Empty msgid. It is reserved by GNU gettext:
> gettext("") returns the header entry with meta information, not the empty string.
>
> Indeed. In pcbnew/dialogs/dialog_design_rules.cpp:
>
> - // Test net class parameters.
> - for( int row = 0; row < m_grid->GetNumberRows(); row++ )
> - {
> - netclassLabel = GetChars( m_grid->GetRowLabelValue( row ) );
> - netclassError = _( "" ); // Clear the error for this netclass
> + // Test net class parameters.
> + for( int row = 0; row < m_grid->GetNumberRows(); row++ )
> + {
> + netclassLabel = GetChars( m_grid->GetRowLabelValue( row ) );
> + netclassError = _( "" ); // Clear the error for this netclass
>
> - int tracksize = ValueFromString( g_UserUnit,
> - m_grid->GetCellValue( row, GRID_TRACKSIZE ) );
> + int tracksize = ValueFromString( g_UserUnit,
> + m_grid->GetCellValue( row, GRID_TRACKSIZE ) );
> +
> +
> + BTW: In pcbnew/dialogs/dialog_design_rules.cpp:1089
> + // If this netclass contains errors, add it to the error message
> + if ( !netclassError.IsEmpty() )
> + {
> + msg.Printf( _( "Netclass: <b>%s</b><br>" ), netclassLabel );
> + errorMsg += msg;
> + errorMsg += netclassError;
> + errorMsg += _( "<br>" );
> + }
> +
> + The single <br> tag should be translatable?
>
> ** Description changed:
>
> PoEdit report a warning of empty string:
>
> pcbnew/dialogs/dialog_design_rules.cpp:994:
> warning: Empty msgid. It is reserved by GNU gettext:
> gettext("") returns the header entry with meta information, not the empty string.
>
> Indeed. In pcbnew/dialogs/dialog_design_rules.cpp:
>
> // Test net class parameters.
> for( int row = 0; row < m_grid->GetNumberRows(); row++ )
> {
> netclassLabel = GetChars( m_grid->GetRowLabelValue( row ) );
> netclassError = _( "" ); // Clear the error for this netclass
>
> int tracksize = ValueFromString( g_UserUnit,
> m_grid->GetCellValue( row, GRID_TRACKSIZE ) );
>
> + BTW: In pcbnew/dialogs/dialog_design_rules.cpp:1089
> + // If this netclass contains errors, add it to the error message
> + if ( !netclassError.IsEmpty() )
> + {
> + msg.Printf( _( "Netclass: <b>%s</b><br>" ), netclassLabel );
> + errorMsg += msg;
> + errorMsg += netclassError;
> + errorMsg += _( "<br>" );
> + }
>
> - BTW: In pcbnew/dialogs/dialog_design_rules.cpp:1089
> - // If this netclass contains errors, add it to the error message
> - if ( !netclassError.IsEmpty() )
> - {
> - msg.P...

Read more...

Revision history for this message
jean-pierre charras (jp-charras) wrote :

This issue should be fixed.
I fixed a few I18n issues in my recent commit, but did not remember this bug report.
Sorry.

Changed in kicad:
status: New → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.