marked 3 strings for translation.\n* src/Operation.cc: fixed an i18n

* src/Dialog_Partition_New.cc: marked 3 strings for translation.\n* src/Operation.cc: fixed an i18n related crasher and did some cosmetic cleanups.
This commit is contained in:
Bart Hakvoort 2004-10-01 18:36:12 +00:00
parent 3fc4d5b74d
commit 577d0f8112
3 changed files with 54 additions and 55 deletions

View File

@ -1,3 +1,8 @@
2004-10-01 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_Partition_New.cc: marked 3 strings for translation.
* src/Operation.cc: fixed an i18n related crasher and did some cosmetic cleanups.
2004-10-01 Bart Hakvoort <gparted@users.sf.net> 2004-10-01 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_About.cc, * src/Dialog_About.cc,

View File

@ -54,9 +54,9 @@ void Dialog_Partition_New::Set_Data( const Partition & partition, bool any_exten
table_create.attach( label_type, 0,1,0,1,Gtk::FILL); table_create.attach( label_type, 0,1,0,1,Gtk::FILL);
//fill partitiontype menu //fill partitiontype menu
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Primary") ) ; menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Primary Partition") ) ) ;
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Logical") ) ; menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Logical Partition") ) ) ;
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Extended") ) ; menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Extended Partition") ) ) ;
//determine which PartitionType is allowed //determine which PartitionType is allowed
if ( partition.inside_extended ) if ( partition.inside_extended )

View File

@ -43,65 +43,59 @@ Operation::Operation( Device *device, Device *source_device, const Partition & p
Glib::ustring Operation::Get_String() Glib::ustring Operation::Get_String()
{ {
std::ostringstream os;
Glib::ustring temp ; Glib::ustring temp ;
Sector diff ; Sector diff ;
switch ( operationtype ) switch ( operationtype )
{ {
case DELETE : if (partition_original.type == GParted::LOGICAL) case DELETE : if (partition_original.type == GParted::LOGICAL)
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */ temp = _("Logical Partition") ;
os << String::ucompose( _("Delete %1 (%2, %3 MB) from %4"), _("Logical Partition") , partition_original .filesystem, partition_original .Get_Length_MB(), device ->Get_Path() ) ; else
else temp = partition_original .partition ;
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */
os << String::ucompose( _("Delete %1 (%2, %3 MB) from %4"), partition_original .partition, partition_original .filesystem, partition_original .Get_Length_MB(), device ->Get_Path() ) ;
break; /*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */
case CREATE : switch( partition_new.type ) return String::ucompose( _("Delete %1 (%2, %3 MB) from %4"),temp , partition_original .filesystem, partition_original .Get_Length_MB(), device ->Get_Path() ) ;
{
case GParted::PRIMARY : temp = "Primary"; break;
case GParted::LOGICAL : temp = "Logical"; break;
case GParted::EXTENDED : temp = "Extended"; break;
default : break;
}
/*TO TRANSLATORS: looks like Create Logical Partition #1 (ntfs, 2345 MB) on /dev/hda */
os << String::ucompose( _("Create %1 Partition #%2 (%3, %4 MB) on %5"), temp , partition_new.partition_number, partition_new.filesystem , partition_new .Get_Length_MB(), device ->Get_Path() ) ;
break;
case RESIZE_MOVE : //if startsector has changed >= 1 MB we consider it a move
diff = Abs( partition_new .sector_start - partition_original .sector_start ) ;
if ( diff >= MEGABYTE ) case CREATE : switch( partition_new.type )
{ {
if ( partition_new .sector_start > partition_original .sector_start ) case GParted::PRIMARY : temp = _("Primary Partition"); break;
os << String::ucompose( _("Move %1 forward by %2 MB "), partition_new.partition, Sector_To_MB( diff ) ) ; case GParted::LOGICAL : temp = _("Logical Partition") ; break;
else case GParted::EXTENDED : temp = _("Extended Partition"); break;
os << String::ucompose( _("Move %1 backward by %2 MB "), partition_new.partition, Sector_To_MB( diff ) ) ; default : break;
} }
/*TO TRANSLATORS: looks like Create Logical Partition #1 (ntfs, 2345 MB) on /dev/hda */
return String::ucompose( _("Create %1 #%2 (%3, %4 MB) on %5"), temp, partition_new.partition_number, partition_new.filesystem , partition_new .Get_Length_MB(), device ->Get_Path() ) ;
case RESIZE_MOVE: //if startsector has changed >= 1 MB we consider it a move
diff = Abs( partition_new .sector_start - partition_original .sector_start ) ;
if ( diff >= MEGABYTE )
{
if ( partition_new .sector_start > partition_original .sector_start )
temp = String::ucompose( _("Move %1 forward by %2 MB"), partition_new.partition, Sector_To_MB( diff ) ) ;
else
temp = String::ucompose( _("Move %1 backward by %2 MB"), partition_new.partition, Sector_To_MB( diff ) ) ;
}
//check if size has changed ( we only consider changes >= 1 MB ) //check if size has changed ( we only consider changes >= 1 MB )
diff = Abs( (partition_original .sector_end - partition_original .sector_start) - (partition_new .sector_end - partition_new .sector_start) ) ; diff = Abs( (partition_original .sector_end - partition_original .sector_start) - (partition_new .sector_end - partition_new .sector_start) ) ;
if ( diff >= MEGABYTE ) if ( diff >= MEGABYTE )
{ {
if ( os.str() == "" ) if ( temp .empty() )
os << String::ucompose( _("Resize %1 from %2 MB to %3 MB"), partition_new.partition, partition_original .Get_Length_MB(), partition_new .Get_Length_MB() ) ; temp = String::ucompose( _("Resize %1 from %2 MB to %3 MB"), partition_new.partition, partition_original .Get_Length_MB(), partition_new .Get_Length_MB() ) ;
else else
os << String::ucompose( _("and Resize %1 from %2 MB to %3 MB"), partition_new.partition, partition_original .Get_Length_MB(), partition_new .Get_Length_MB() ) ; temp += " " + String::ucompose( _("and Resize %1 from %2 MB to %3 MB"), partition_new.partition, partition_original .Get_Length_MB(), partition_new .Get_Length_MB() ) ;
//os << c_buf ; }
} if ( temp .empty() )
if ( os.str() == "" ) temp = _("Sorry, changes are too small to make sense");
os << _("Sorry, changes are too small to make sense");
break; return temp;
case CONVERT : /*TO TRANSLATORS: looks like Convert /dev/hda4 from ntfs to linux-swap */ case CONVERT : /*TO TRANSLATORS: looks like Convert /dev/hda4 from ntfs to linux-swap */
os << String::ucompose( _( "Convert %1 from %2 to %3"), partition_original .partition, partition_original .filesystem, partition_new .filesystem ) ; return String::ucompose( _( "Convert %1 from %2 to %3"), partition_original .partition, partition_original .filesystem, partition_new .filesystem ) ;
break; case COPY : /*TO TRANSLATORS: looks like Copy /dev/hda4 to /dev/hdd (start at 2500 MB) */
case COPY : /*TO TRANSLATORS: looks like Copy /dev/hda4 to /dev/hdd (start at 2500 MB) */ return String::ucompose( _("Copy %1 to %2 (start at %3 MB)"), partition_new .partition, device ->Get_Path(), Sector_To_MB( partition_new .sector_start ) ) ;
os << String::ucompose( _("Copy %1 to %2 (start at %3 MB)"), partition_new .partition, device ->Get_Path(), Sector_To_MB( partition_new .sector_start ) ) ; default : return "";
break ;
} }
return os.str();
} }