7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 12:31:41 +00:00

Remove beginning/ending spaces in translations

Adding space padding makes translations more difficult by increasing
string counts
This commit is contained in:
Seth Hillbrand 2020-10-20 12:05:04 -07:00
parent 6cbe2131ab
commit 4085757aeb
49 changed files with 210 additions and 145 deletions

View File

@ -472,7 +472,7 @@ bool BOARD_ADAPTER::createBoardPolygon( wxString* aErrorMsg )
success = m_board->GetBoardPolygonOutlines( m_board_poly, &msg );
if( aErrorMsg )
*aErrorMsg = _( "Board outline is not closed: " ) + msg;
*aErrorMsg = _( "Board outline is not closed:" ) + wxS( " " )+ msg;
}
return success;

View File

@ -328,7 +328,7 @@ void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
path = m_mruPath;
wxFileDialog fileDlg( this, _( "Choose Image" ), path, wxEmptyString,
_( "Image Files " ) + wxImage::GetImageExtWildcard(),
_( "Image Files" ) + wxS( " " )+ wxImage::GetImageExtWildcard(),
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
int diag = fileDlg.ShowModal();

View File

@ -210,7 +210,7 @@ void PANEL_COLOR_SETTINGS::createThemeList( const wxString& aCurrent )
wxString name = settings->GetName();
if( settings->IsReadOnly() )
name += _( " (read-only)" );
name += wxS( " " ) + _( "(read-only)" );
int pos = m_cbTheme->Append( name, static_cast<void*>( settings ) );

View File

@ -176,14 +176,14 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
switch( aLine.severity )
{
case RPT_SEVERITY_ERROR:
retv = "<font color=\"red\" size=3>" + _( "Error: " ) + "</font>"
retv = "<font color=\"red\" size=3>" + _( "Error:" ) + " </font>"
"<font size=3>" + aLine.message + "</font><br>";
break;
case RPT_SEVERITY_WARNING:
retv = "<font size=3>" + _( "Warning: " ) + aLine.message + "</font><br>";
retv = "<font size=3>" + _( "Warning:" ) + wxS( " " )+ aLine.message + "</font><br>";
break;
case RPT_SEVERITY_INFO:
retv = "<font color=\"dark gray\" size=3>" + _( "Info: " ) + aLine.message + "</font><br>";
retv = "<font color=\"dark gray\" size=3>" + _( "Info:" ) + wxS( " " )+ aLine.message + "</font><br>";
break;
case RPT_SEVERITY_ACTION:
retv = "<font color=\"dark green\" size=3>" + aLine.message + "</font><br>";
@ -201,11 +201,11 @@ wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine )
switch( aLine.severity )
{
case RPT_SEVERITY_ERROR:
return _( "Error: " ) + aLine.message + wxT( "\n" );
return _( "Error:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
case RPT_SEVERITY_WARNING:
return _( "Warning: " ) + aLine.message + wxT( "\n" );
return _( "Warning:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
case RPT_SEVERITY_INFO:
return _( "Info: " ) + aLine.message + wxT( "\n" );
return _( "Info:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
default:
return aLine.message + wxT( "\n" );
}

View File

@ -35,13 +35,13 @@ EDA_POSITION_CTRL::EDA_POSITION_CTRL( wxWindow* parent, const wxString& title, c
{
m_UserUnit = user_unit;
m_TextX = new wxStaticText( parent, -1, title + _( " X:" ) );
m_TextX = new wxStaticText( parent, -1, title + wxS( " " ) + _( "X:" ) );
BoxSizer->Add( m_TextX, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
m_FramePosX = new wxTextCtrl( parent, -1, wxEmptyString, wxDefaultPosition );
BoxSizer->Add( m_FramePosX, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_TextY = new wxStaticText( parent, -1, title + _( " Y:" ) );
m_TextY = new wxStaticText( parent, -1, title + wxS( " " ) + _( "Y:" ) );
BoxSizer->Add( m_TextY, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
m_FramePosY = new wxTextCtrl( parent, -1, wxEmptyString );

View File

@ -482,10 +482,10 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
wxString msg = _( "Alias: " );
msg.append( tpath.m_alias );
msg.append( wxT( "\n" ) );
msg.append( _( "This path: " ) );
msg.append( _( "This path:" ) + wxS( " " ));
msg.append( tpath.m_pathvar );
msg.append( wxT( "\n" ) );
msg.append( _( "Existing path: " ) );
msg.append( _( "Existing path:" ) + wxS( " " ));
msg.append( sPL->m_pathvar );
wxMessageBox( msg, _( "Bad alias (duplicate name)" ) );

View File

@ -309,7 +309,7 @@ bool COLOR_SETTINGS::migrateSchema0to1()
fpsettings->erase( "fpedit" );
fpsettings->Load();
fpsettings->SetName( fpsettings->GetName() + _( " (Footprints)" ) );
fpsettings->SetName( fpsettings->GetName() + wxS( " " ) + _( "(Footprints)" ) );
m_manager->Save( fpsettings );
// Now we can get rid of our own copy

View File

@ -310,7 +310,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting, true );
SetStatusText( _( "Selected net: " ) + UnescapeString( netName ) );
SetStatusText( _( "Selected net:" ) + wxS( " " ) + UnescapeString( netName ) );
return;
}

View File

@ -200,7 +200,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches()
wxString name = LayerName( layer );
if( layer == LAYER_SCHEMATIC_GRID_AXES )
name += _( " (symbol editor only)" );
name += wxS( " " ) + _( "(symbol editor only)" );
createSwatch( layer, name );
}

View File

@ -1187,7 +1187,7 @@ void SCH_EDIT_FRAME::UpdateTitle()
if( fn.FileExists() )
{
if( !fn.IsFileWritable() )
append = _( "[Read Only] " );
append = _( "[Read Only]" ) + wxS( " " );
}
else
append = nofile;

View File

@ -169,7 +169,7 @@ wxString SCH_FIELD::GetShownText( int aDepth ) const
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
{
if( m_id == SHEETFILENAME )
text = _( "File: " ) + text;
text = _( "File:" ) + wxS( " " )+ text;
}
return text;

View File

@ -246,7 +246,7 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
if( node->m_Type == LIB_TREE_NODE::LIB )
{
if( !m_libMgr->IsLibraryLoaded( node->m_Name ) )
aVariant = _( "(failed to load) " ) + aVariant.GetString();
aVariant = _( "(failed to load)" ) + wxS( " " ) + aVariant.GetString();
}
break;

View File

@ -151,30 +151,61 @@ void EE_INSPECTION_TOOL::checkPart( LIB_PART* aPart )
dup_error++;
/* TODO I dare someone to find a way to make happy translators on this thing! Lorenzo */
msg = wxString::Format( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
next->GetNumber(),
next->GetName(),
next->GetPosition().x / 1000.0, -next->GetPosition().y / 1000.0,
pin->GetNumber(),
pin->GetName(),
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0 );
if( aPart->GetUnitCount() > 1 )
if( aPart->HasConversion() && next->GetConvert() )
{
msg += wxString::Format( _( " in units %c and %c" ),
'A' + next->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
}
if( aPart->HasConversion() )
{
if( next->GetConvert() )
msg += _( " of converted" );
if( aPart->GetUnitCount() <= 1 )
{
msg = wxString::Format( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b> of converted" ),
next->GetNumber(),
next->GetName(),
next->GetPosition().x / 1000.0, -next->GetPosition().y / 1000.0,
pin->GetNumber(),
pin->GetName(),
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0 );
}
else
msg += _( " of normal" );
{
msg = wxString::Format( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>"
" in units %c and %c of converted" ),
next->GetNumber(),
next->GetName(),
next->GetPosition().x / 1000.0, -next->GetPosition().y / 1000.0,
pin->GetNumber(),
pin->GetName(),
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0,
'A' + next->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
}
}
else
{
if( aPart->GetUnitCount() <= 1 )
{
msg = wxString::Format( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
next->GetNumber(),
next->GetName(),
next->GetPosition().x / 1000.0, -next->GetPosition().y / 1000.0,
pin->GetNumber(),
pin->GetName(),
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0 );
}
else
{
msg = wxString::Format( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>"
" in units %c and %c" ),
next->GetNumber(),
next->GetName(),
next->GetPosition().x / 1000.0, -next->GetPosition().y / 1000.0,
pin->GetNumber(),
pin->GetName(),
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0,
'A' + next->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
}
}
msg += wxT( ".<br>" );
@ -200,14 +231,14 @@ void EE_INSPECTION_TOOL::checkPart( LIB_PART* aPart )
pin->GetPosition().x / 1000.0, -pin->GetPosition().y / 1000.0 );
if( aPart->GetUnitCount() > 1 )
msg += wxString::Format( _( " in symbol %c" ), 'A' + pin->GetUnit() - 1 );
msg += wxString::Format( wxS( " " ) + _( "in symbol %c" ), 'A' + pin->GetUnit() - 1 );
if( aPart->HasConversion() )
{
if( pin->GetConvert() )
msg += _( " of converted" );
msg += wxS( " " ) + _( "of converted" );
else
msg += _( " of normal" );
msg += wxS( " " ) + _( "of normal" );
}
msg += wxT( ".<br>" );

View File

@ -379,7 +379,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
wxFileDialog dlg( m_frame, _( "Choose Image" ), wxEmptyString, wxEmptyString,
_( "Image Files " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
_( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
if( dlg.ShowModal() != wxID_OK )
continue;

View File

@ -459,7 +459,7 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
: _( "Reached end of sheet." );
// Show the popup during the time period the user can wrap the search
m_frame->ShowFindReplaceStatus( msg + _( " Find again to wrap around to the start." ),
m_frame->ShowFindReplaceStatus( msg + wxS( " " ) + _( "Find again to wrap around to the start." ),
4000 );
wrapAroundTimer.StartOnce( 4000 );
}

View File

@ -664,7 +664,7 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
title.Printf( wxT( "%s%s \u2014 " ) + _( "GerbView" ),
filename.GetFullName(),
gerber->m_IsX2_file ? _( " (with X2 attributes)" )
gerber->m_IsX2_file ? wxS( " " ) + _( "(with X2 attributes)" )
: wxString( wxEmptyString ) );
SetTitle( title );

View File

@ -116,10 +116,10 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE );
if( !m_cmpText )
m_cmpText = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Cmp: ") );
m_cmpText = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Cmp:" ) + wxS( " " ) );
m_SelComponentBox->SetToolTip( _("Highlight items belonging to this component") );
m_cmpText->SetLabel( _( "Cmp: ") ); // can change when changing the language
m_cmpText->SetLabel( _( "Cmp:" ) + wxS( " " ) ); // can change when changing the language
m_auxiliaryToolBar->AddControl( m_cmpText );
m_auxiliaryToolBar->AddControl( m_SelComponentBox );
m_auxiliaryToolBar->AddSpacer( 5 );

View File

@ -601,7 +601,7 @@ void KICAD_MANAGER_FRAME::ProjectChanged()
title += fn.GetName();
if( !fn.IsDirWritable() )
title += _( " [Read Only]" );
title += wxS( " " ) + _( "[Read Only]" );
title += wxS(" \u2014 ");
}

View File

@ -49,12 +49,12 @@ PROJECT_TEMPLATE::PROJECT_TEMPLATE( const wxString& aPath )
if( !wxFileName::DirExists( m_basePath.GetPath() ) )
{
// Error, the path doesn't exist!
m_title = _( "Could open the template path! " ) + aPath;
m_title = _( "Could open the template path!" ) + wxS( " " ) + aPath;
}
else if( !wxFileName::DirExists( m_metaPath.GetPath() ) )
{
// Error, the meta information directory doesn't exist!
m_title = _( "Couldn't open the meta information directory for this template! " ) +
m_title = _( "Couldn't open the meta information directory for this template!" ) + wxS( " " ) +
m_metaPath.GetPath();
}
else if( !wxFileName::FileExists( m_metaHtmlFile.GetFullPath() ) )

View File

@ -843,7 +843,7 @@ WS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
case WS_DATA_ITEM::WS_BITMAP:
{
wxFileDialog fileDlg( this, _( "Choose Image" ), wxEmptyString, wxEmptyString,
_( "Image Files " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
_( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
if( fileDlg.ShowModal() != wxID_OK )
return NULL;

View File

@ -90,7 +90,7 @@ wxString BOARD_ITEM::LayerMaskDescribe() const
wxString layerInfo = board->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
if( testLayers.count() > 1 )
layerInfo << _( " and others" );
layerInfo << wxS( " " ) + _( "and others" );
return layerInfo;
}

View File

@ -772,7 +772,7 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM
if( m_Attributs & MOD_EXCLUDE_FROM_BOM )
addToken( &attrs, _( "exclude from BOM" ) );
aList.emplace_back( _( "Status: " ) + status, _( "Attributes: " ) + attrs, BROWN );
aList.emplace_back( _( "Status: " ) + status, _( "Attributes:" ) + wxS( " " ) + attrs, BROWN );
msg.Printf( "%.2f", GetOrientationDegrees() );
aList.emplace_back( _( "Rotation" ), msg, BROWN );

View File

@ -527,10 +527,12 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan()
if( !m_ExcludeArray.empty() )
{
message += _( "\nExcluding: " );
for( wxString& Exclude : m_ExcludeArray ) //Show the refdes we are excluding
message += Exclude + " ";
message += _( " from reannotation\n\n" );
wxString excludes;
for( wxString& exclude : m_ExcludeArray ) //Show the refdes we are excluding
excludes += exclude + " ";
message += wxString::Format( _( "\nExcluding: %s from reannotation\n\n" ), excludes );
}
message += _( "\n Change Array\n***********************\n" );
@ -539,7 +541,7 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan()
{
message += wxString::Format( "%s -> %s %s %s\n", Change.OldRefDesString, Change.NewRefDes,
ActionMessage[Change.Action],
UpdateRefDes != Change.Action ? _( " will be ignored" ) : wxString("") );
UpdateRefDes != Change.Action ? wxS( " " ) + _( "will be ignored" ) : wxString("") );
}
ShowReport( message, RPT_SEVERITY_INFO );
@ -932,6 +934,6 @@ RefDesChange* DIALOG_BOARD_REANNOTATE::GetNewRefDes( MODULE* aMod )
if( aMod->m_Uuid == m_ChangeArray[i].Uuid )
return ( &m_ChangeArray[i] );
ShowReport( _( "Module not found in changelist " ) + aMod->GetReference(), RPT_SEVERITY_ERROR );
ShowReport( _( "Module not found in changelist" ) + wxS( " " )+ aMod->GetReference(), RPT_SEVERITY_ERROR );
return nullptr; //Should never happen
}

View File

@ -643,35 +643,35 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
}
msg << _( "PCB statistics report\n=====================" ) << "\n";
msg << _( "- Date: " ) << wxDateTime::Now().Format() << "\n";
msg << _( "- Project: " ) << Prj().GetProjectName() << "\n";
msg << _( "- Board name: " ) << boardName << "\n";
msg << wxS( "- " ) << _( "Date" ) << wxS( ": " ) << wxDateTime::Now().Format() << "\n";
msg << wxS( "- " ) << _( "Project" ) << wxS( ": " )<< Prj().GetProjectName() << "\n";
msg << wxS( "- " ) << _( "Board name" ) << wxS( ": " )<< boardName << "\n";
msg << "\n";
msg << _( "Board\n-----" ) << "\n";
msg << _( "Board" ) << "\n-----\n";
if( m_hasOutline )
{
msg << _( "- Width: " ) << MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n";
msg << _( "- Height: " ) << MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n";
msg << _( "- Area: " ) << MessageTextFromValue( GetUserUnits(), m_boardArea, true, EDA_DATA_TYPE::AREA );
msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n";
msg << wxS( "- " ) << _( "Height" ) << wxS( ": " )<< MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n";
msg << wxS( "- " ) << _( "Area" ) + wxS( ": " ) << MessageTextFromValue( GetUserUnits(), m_boardArea, true, EDA_DATA_TYPE::AREA );
msg << "\n";
}
else
{
msg << _( "- Width: " ) << _( "unknown" ) << "\n";
msg << _( "- Height: " ) << _( "unknown" ) << "\n";
msg << _( "- Area: " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Area" ) << wxS( ": " ) << _( "unknown" ) << "\n";
}
msg << "\n";
msg << _( "Pads\n----" ) << "\n";
msg << _( "Pads" ) << "\n----\n";
for( auto& type : m_padsTypes )
msg << "- " << type.title << " " << type.qty << "\n";
msg << "\n";
msg << _( "Vias\n----" ) << "\n";
msg << _( "Vias" ) << "\n----\n";
for( auto& type : m_viasTypes )
msg << "- " << type.title << " " << type.qty << "\n";
@ -707,13 +707,13 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
//Write components amount to file
msg << "\n";
msg << _( "Components\n----------" ) << "\n";
msg << _( "Components" ) << "\n----------\n";
msg << "\n";
printGridToStringAsTable( m_gridComponents, msg, false, false, true );
msg << "\n";
msg << _( "Drill holes\n-----------" ) << "\n";
msg << _( "Drill holes" ) << "\n-----------\n";
msg << "\n";
printGridToStringAsTable( m_gridDrills, msg, false, true, false );

View File

@ -220,7 +220,7 @@ void PCB_EDIT_FRAME::OnExportIDF3( wxCommandEvent& event )
if( !Export_IDF3( GetBoard(), fullFilename, thou, aXRef, aYRef ) )
{
wxString msg = _( "Unable to create " ) + fullFilename;
wxString msg = wxString::Format( _( "Unable to create %s" ), fullFilename );
wxMessageBox( msg );
return;
}

Some files were not shown because too many files have changed in this diff Show More