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:
parent
3fc4d5b74d
commit
577d0f8112
|
@ -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>
|
||||
|
||||
* src/Dialog_About.cc,
|
||||
|
|
|
@ -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);
|
||||
|
||||
//fill partitiontype menu
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Primary") ) ;
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Logical") ) ;
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( "Extended") ) ;
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Primary Partition") ) ) ;
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Logical Partition") ) ) ;
|
||||
menu_type.items().push_back(Gtk::Menu_Helpers::MenuElem( _("Extended Partition") ) ) ;
|
||||
|
||||
//determine which PartitionType is allowed
|
||||
if ( partition.inside_extended )
|
||||
|
|
|
@ -43,65 +43,59 @@ Operation::Operation( Device *device, Device *source_device, const Partition & p
|
|||
|
||||
Glib::ustring Operation::Get_String()
|
||||
{
|
||||
std::ostringstream os;
|
||||
Glib::ustring temp ;
|
||||
Sector diff ;
|
||||
|
||||
switch ( operationtype )
|
||||
{
|
||||
case DELETE : if (partition_original.type == GParted::LOGICAL)
|
||||
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */
|
||||
os << String::ucompose( _("Delete %1 (%2, %3 MB) from %4"), _("Logical Partition") , partition_original .filesystem, partition_original .Get_Length_MB(), device ->Get_Path() ) ;
|
||||
else
|
||||
/*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;
|
||||
case CREATE : switch( partition_new.type )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
if ( partition_new .sector_start > partition_original .sector_start )
|
||||
os << String::ucompose( _("Move %1 forward by %2 MB "), partition_new.partition, Sector_To_MB( diff ) ) ;
|
||||
else
|
||||
os << String::ucompose( _("Move %1 backward by %2 MB "), partition_new.partition, Sector_To_MB( diff ) ) ;
|
||||
}
|
||||
case DELETE : if (partition_original.type == GParted::LOGICAL)
|
||||
temp = _("Logical Partition") ;
|
||||
else
|
||||
temp = partition_original .partition ;
|
||||
|
||||
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */
|
||||
return String::ucompose( _("Delete %1 (%2, %3 MB) from %4"),temp , partition_original .filesystem, partition_original .Get_Length_MB(), device ->Get_Path() ) ;
|
||||
|
||||
case CREATE : switch( partition_new.type )
|
||||
{
|
||||
case GParted::PRIMARY : temp = _("Primary Partition"); break;
|
||||
case GParted::LOGICAL : temp = _("Logical Partition") ; break;
|
||||
case GParted::EXTENDED : temp = _("Extended Partition"); break;
|
||||
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 )
|
||||
diff = Abs( (partition_original .sector_end - partition_original .sector_start) - (partition_new .sector_end - partition_new .sector_start) ) ;
|
||||
|
||||
//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) ) ;
|
||||
|
||||
if ( diff >= MEGABYTE )
|
||||
{
|
||||
if ( os.str() == "" )
|
||||
os << String::ucompose( _("Resize %1 from %2 MB to %3 MB"), partition_new.partition, partition_original .Get_Length_MB(), partition_new .Get_Length_MB() ) ;
|
||||
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() ) ;
|
||||
//os << c_buf ;
|
||||
}
|
||||
if ( os.str() == "" )
|
||||
os << _("Sorry, changes are too small to make sense");
|
||||
|
||||
break;
|
||||
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 ) ;
|
||||
break;
|
||||
case COPY : /*TO TRANSLATORS: looks like Copy /dev/hda4 to /dev/hdd (start at 2500 MB) */
|
||||
os << String::ucompose( _("Copy %1 to %2 (start at %3 MB)"), partition_new .partition, device ->Get_Path(), Sector_To_MB( partition_new .sector_start ) ) ;
|
||||
break ;
|
||||
if ( diff >= MEGABYTE )
|
||||
{
|
||||
if ( temp .empty() )
|
||||
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
|
||||
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() ) ;
|
||||
}
|
||||
if ( temp .empty() )
|
||||
temp = _("Sorry, changes are too small to make sense");
|
||||
|
||||
return temp;
|
||||
case CONVERT : /*TO TRANSLATORS: looks like Convert /dev/hda4 from ntfs to linux-swap */
|
||||
return String::ucompose( _( "Convert %1 from %2 to %3"), partition_original .partition, partition_original .filesystem, partition_new .filesystem ) ;
|
||||
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 ) ) ;
|
||||
default : return "";
|
||||
}
|
||||
|
||||
return os.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue