another string composition bad for l10n

Delete $1 / Format $1 where $1 can be Header / Footer
It turned out that translation of Header and Footer
can be different when deleting and when formatting, at
least in Estonian.
This commit is contained in:
Andras Timar
2012-01-02 13:53:27 +01:00
parent 77b7bd9b36
commit 95adf2a3d6
4 changed files with 26 additions and 17 deletions

View File

@@ -1442,7 +1442,6 @@ Menu MN_HEADERFOOTER_BUTTON
{ {
Identifier = FN_HEADERFOOTER_EDIT ; Identifier = FN_HEADERFOOTER_EDIT ;
HelpID = CMD_FN_HEADERFOOTER_EDIT ; HelpID = CMD_FN_HEADERFOOTER_EDIT ;
Text [ en-US ] = "Format $1..." ;
}; };
MenuItem MenuItem
{ {
@@ -1454,7 +1453,6 @@ Menu MN_HEADERFOOTER_BUTTON
{ {
Identifier = FN_HEADERFOOTER_DELETE ; Identifier = FN_HEADERFOOTER_DELETE ;
HelpID = CMD_FN_HEADERFOOTER_DELETE ; HelpID = CMD_FN_HEADERFOOTER_DELETE ;
Text [ en-US ] = "Delete $1..." ;
}; };
}; };
}; };

View File

@@ -171,17 +171,17 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
m_pPopupMenu = new PopupMenu( SW_RES( MN_HEADERFOOTER_BUTTON ) ); m_pPopupMenu = new PopupMenu( SW_RES( MN_HEADERFOOTER_BUTTON ) );
// Rewrite the menu entries' text // Rewrite the menu entries' text
String sType = SW_RESSTR( STR_FOOTER );
if ( m_bIsHeader ) if ( m_bIsHeader )
sType = SW_RESSTR( STR_HEADER ); {
SwRewriter aRewriter; m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_HEADER ) );
aRewriter.AddRule( String::CreateFromAscii( "$1" ), sType ); m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_HEADER ) );
}
else
{
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_FOOTER ) );
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_FOOTER ) );
}
String aText = m_pPopupMenu->GetItemText( FN_HEADERFOOTER_EDIT );
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, aRewriter.Apply( aText ) );
aText = m_pPopupMenu->GetItemText( FN_HEADERFOOTER_DELETE );
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, aRewriter.Apply( aText ) );
SetPopupMenu( m_pPopupMenu ); SetPopupMenu( m_pPopupMenu );
m_aFadeTimer.SetTimeout( 50 ); m_aFadeTimer.SetTimeout( 50 );

View File

@@ -83,8 +83,10 @@
#define STR_HEADER_TITLE (RC_DOCVW_BEGIN + 22) #define STR_HEADER_TITLE (RC_DOCVW_BEGIN + 22)
#define STR_FOOTER_TITLE (RC_DOCVW_BEGIN + 23) #define STR_FOOTER_TITLE (RC_DOCVW_BEGIN + 23)
#define STR_HEADER (RC_DOCVW_BEGIN + 24) #define STR_DELETE_HEADER (RC_DOCVW_BEGIN + 24)
#define STR_FOOTER (RC_DOCVW_BEGIN + 25) #define STR_FORMAT_HEADER (RC_DOCVW_BEGIN + 25)
#define STR_DELETE_FOOTER (RC_DOCVW_BEGIN + 26)
#define STR_FORMAT_FOOTER (RC_DOCVW_BEGIN + 27)
#define MSG_READONLY_CONTENT (RC_DOCVW_BEGIN + 1) #define MSG_READONLY_CONTENT (RC_DOCVW_BEGIN + 1)

View File

@@ -301,13 +301,22 @@ String STR_FOOTER_TITLE
Text [ en-US ] = "Footer (%1)" ; Text [ en-US ] = "Footer (%1)" ;
}; };
String STR_HEADER String STR_DELETE_HEADER
{ {
Text [ en-US ] = "Header" ; Text [ en-US ] = "Delete Header..." ;
}; };
String STR_FOOTER String STR_FORMAT_HEADER
{ {
Text [ en-US ] = "Footer" ; Text [ en-US ] = "Format Header..." ;
}; };
String STR_DELETE_FOOTER
{
Text [ en-US ] = "Delete Footer..." ;
};
String STR_FORMAT_FOOTER
{
Text [ en-US ] = "Format Footer..." ;
};