summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-04-09 17:06:23 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-04-09 17:06:23 +0200
commitfa3008044034b173121bd51bf034fa3e2b6ff607 (patch)
tree774933c3c3b204a130e56e289a9b2d8083820fa4
parent916cfbd5c313562c76212064438e4292a1556b1b (diff)
QPhotRec: add French translation
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac11
-rw-r--r--src/Makefile.am22
-rw-r--r--src/lang/qphotorec.fr.ts235
-rw-r--r--src/qmainrec.cpp15
-rw-r--r--src/qphotorec.cpp112
-rw-r--r--src/qphotorec_locale.qrc6
7 files changed, 343 insertions, 59 deletions
diff --git a/Makefile.am b/Makefile.am
index 333370d..6d45f6b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,6 +18,7 @@ EXTRA_DIST = AUTHORS COPYING ChangeLog INFO INSTALL NEWS README.md README_dev_ph
src/gnome/go-previous.png \
src/gnome/help-about.png \
src/gnome/image-x-generic.png \
+ src/lang/qphotorec.fr.ts \
win/readme.txt win/photorec_win.exe.manifest win/qphotorec_win.exe.manifest \
win/testdisk_win.exe.manifest \
Android.mk jni/Android.mk
diff --git a/configure.ac b/configure.ac
index 89d9a62..bf21a55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AC_PREREQ([2.59])
AC_INIT([testdisk],[7.1-WIP],[grenier@cgsecurity.org])
AC_LANG(C)
sinclude(acx_pthread.m4)
-TESTDISKDATE="February 2016"
+TESTDISKDATE="April 2016"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
AC_CONFIG_AUX_DIR(config)
@@ -318,6 +318,7 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG
AC_ARG_VAR(WINDRES, [Windows Resource compiler tool path])
AC_PATH_TOOL(WINDRES,windres,)
@@ -843,7 +844,7 @@ done
unset option
AC_LANG_PUSH([C++])
-for option in -Wall -MD -Wpointer-arith -Wmissing-declarations -Wshadow -Wwrite-strings -W -Wcast-align -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Winline -Wdisabled-optimization -Wmissing-format-attribute -Wmultichar -Wformat=2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC
+for option in -Wall -MD -Wpointer-arith -Wmissing-declarations -Wshadow -Wwrite-strings -W -Wcast-align -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Wdisabled-optimization -Wmissing-format-attribute -Wmultichar -Wformat=2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC
do
SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $option"
@@ -910,6 +911,11 @@ then
AC_MSG_WARN(Could not find a rcc-qt5 or rcc tool in your PATH.)
use_qt=false
fi
+ AC_CHECK_TOOLS(LRELEASE,[lrelease-qt5 lrelease],)
+ if test x$LRELEASE = x ; then
+ AC_MSG_WARN(Could not find a lrelease-qt5 or lrelease tool in your PATH.)
+ use_qt=false
+ fi
qphotorec_LDADD="$qphotorec_LDADD $QTGUI_LIBS $QTWIDGETS_LIBS"
qphotorec_CXXFLAGS="$qphotorec_CXXFLAGS $QTGUI_CFLAGS $QTWIDGETS_CFLAGS"
fi
@@ -984,6 +990,7 @@ AC_SUBST(CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(MOC)
+AC_SUBST(LRELEASE)
AC_SUBST(fidentify_LDADD)
AC_SUBST(testdisk_LDADD)
AC_SUBST(photorec_LDADD)
diff --git a/src/Makefile.am b/src/Makefile.am
index 550d4e1..af42270 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -343,16 +343,22 @@ photorec_H = photorec.h phcfg.h addpart.h chgarch.h dir.h exfatp.h ext2grp.h ex
photorec_ncurses_C = addpartn.c askloc.c chgarchn.c chgtype.c chgtypen.c fat_cluster.c fat_unformat.c geometryn.c hiddenn.c intrfn.c nodisk.c parti386n.c partgptn.c partmacn.c partsunn.c partxboxn.c pbanner.c pblocksize.c pdiskseln.c pfree_whole.c phbf.c phbs.c phnc.c phrecn.c ppartseln.c psearchn.c
photorec_ncurses_H = addpartn.h askloc.h chgarchn.h chgtype.h chgtypen.h fat_cluster.h fat_unformat.h geometryn.h hiddenn.h intrfn.h nodisk.h parti386n.h partgptn.h partmacn.h partsunn.h partxboxn.h pblocksize.h pdiskseln.h pfree_whole.h pnext.h phbf.h phbs.h phnc.h phrecn.h ppartseln.h psearch.h psearchn.h
+QT_TS = \
+ lang/qphotorec.fr.ts
+
photorec_SOURCES = phmain.c $(photorec_C) $(photorec_H) $(photorec_ncurses_C) $(photorec_ncurses_H) $(file_C) $(file_H) $(base_C) $(base_H) partgptro.c $(fs_C) $(fs_H) $(ICON_PHOTOREC) suspend_no.c
photorecf_SOURCES = phmain.c $(photorec_C) $(photorec_H) $(photorec_ncurses_C) $(photorec_ncurses_H) $(file_C) $(file_H) $(base_C) $(base_H) partgptro.c $(fs_C) $(fs_H) $(ICON_PHOTOREC) suspend.c
-qphotorec_SOURCES = qmainrec.cpp qphotorec.cpp qphotorec.h qphotorec.qrc qphbs.cpp qpsearch.cpp psearch.h chgtype.c chgtype.h $(photorec_C) $(photorec_H) $(file_C) $(file_H) $(base_C) $(base_H) partgptro.c $(fs_C) $(fs_H) $(ICON_QPHOTOREC) suspend_no.c
+qphotorec_SOURCES = qmainrec.cpp qphotorec.cpp qphotorec.h qphotorec.qrc qphotorec_locale.qrc qphbs.cpp qpsearch.cpp psearch.h chgtype.c chgtype.h $(photorec_C) $(photorec_H) $(file_C) $(file_H) $(base_C) $(base_H) partgptro.c $(fs_C) $(fs_H) $(ICON_QPHOTOREC) suspend_no.c $(QT_TS)
-nodist_qphotorec_SOURCES = moc_qphotorec.cpp rcc_qphotorec.cpp
+nodist_qphotorec_SOURCES = moc_qphotorec.cpp rcc_qphotorec.cpp rcc_qphotorec_locale.cpp
fidentify_SOURCES = fidentify.c common.c common.h misc.c misc.h phcfg.c phcfg.h setdate.c setdate.h $(file_C) $(file_H) log.c log.h crc.c crc.h ext2_common.c fat_common.c fat_common.h suspend_no.c
+QT_QM=$(QT_TS:.ts=.qm)
+SECONDARY: $(QT_QM)
+
CLEANFILES = $(nodist_qphotorec_SOURCES)
DISTCLEANFILES = *~ core
@@ -362,10 +368,14 @@ small: $(sbin_PROGRAMS) $(bin_PROGRAMS)
extras: $(EXTRA_PROGRAMS)
moc_qphotorec.cpp: qphotorec.h
- $(MOC) $< -o $@
+ $(AM_V_GEN) $(MOC) $< -o $@
rcc_qphotorec.cpp: qphotorec.qrc
- $(RCC) $< -o $@
+ $(AM_V_GEN) $(RCC) $< -o $@ -name qphotorec
+
+rcc_qphotorec_locale.cpp: qphotorec_locale.qrc $(QT_QM)
+ $(LN_S) $< $(@D) || exit 0
+ $(AM_V_GEN) $(RCC) $(@D)/$(<F) -o $@ -name qphotorec_locale
Android.mk: Makefile.am
androgenizer \
@@ -383,3 +393,7 @@ Android.mk: Makefile.am
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) \
-:LDFLAGS $(testdisk_LDADD) $(LIBS) \
> $@
+
+%.qm: %.ts
+ $(MKDIR_P) $(@D)
+ $(AM_V_GEN) $(LRELEASE) -silent $< -qm $@
diff --git a/src/lang/qphotorec.fr.ts b/src/lang/qphotorec.fr.ts
new file mode 100644
index 0000000..e51d01a
--- /dev/null
+++ b/src/lang/qphotorec.fr.ts
@@ -0,0 +1,235 @@
+<?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.1">
+<context>
+ <name>QPhotorec</name>
+ <message>
+ <location filename="src/qphotorec.cpp" line="125"/>
+ <source>QPhotoRec</source>
+ <translation>QPhotoRec</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="156"/>
+ <location filename="src/qphotorec.cpp" line="518"/>
+ <source>Please select a destination to save the recovered files to.</source>
+ <translation>Merci de sélectionner une destination pour sauvegarder les fichiers récupérés.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="170"/>
+ <source>Please select a raw file</source>
+ <translation>Merci de sélectionner une image disque</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="172"/>
+ <source>Raw Files (*.dd *.raw *.img)</source>
+ <translation>Fichiers Raw/Image disque (*.dd *.raw *.img)</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="259"/>
+ <source>Sys=</source>
+ <translation>Sys=</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="261"/>
+ <source>Unknown</source>
+ <translation>Inconnu</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="377"/>
+ <source>No harddisk found</source>
+ <translation>Aucun disque trouvé</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="379"/>
+ <source>No harddisk found
+You need to be administrator to use this program.
+Under Win9x, use the DOS version instead.
+Under Vista or later, select this program, right-click and choose &quot;Run as administrator&quot;.</source>
+ <translation>Aucun disque trouvé.
+Il faut être administrateur pour utiliser ce programme.
+Sous Win9x, utiliser la version DOS plutôt.
+Sous Vista et suivant, lancer ce programme en utilisant le clique droit &quot;Executer en tant qu&apos;administrateur&quot;.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="388"/>
+ <source>No harddisk found
+You need to be root to use PhotoRec.</source>
+ <translation>Aucun disque trouvé.
+Il faut être root pour utiliser ce programme.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="393"/>
+ <source>No Disk!</source>
+ <translation>Pas de disque!</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="452"/>
+ <source>Add a raw disk image...</source>
+ <translation>Ajouter une image disque...</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="458"/>
+ <source>PhotoRec is free software, and comes with ABSOLUTELY NO WARRANTY.</source>
+ <translation>PhotoRec est un logiciel libre, il vient avec ABSOLUMENT AUCUNE GARANTIE.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="459"/>
+ <source>Please select a media to recover from</source>
+ <translation>Merci de sélectionner un média à partir duquel récupérer les données</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="462"/>
+ <source>Disk capacity must be correctly detected for a successful recovery.
+If a disk listed above has an incorrect size, check HD jumper settings and BIOS
+detection, and install the latest OS patches and disk drivers.</source>
+ <translation>La capacité du disque doit être correctement détecter pour une récupération de donnée réussie.
+Si un disque listé ci dessus a une taille incorrecte, vérifier le paramétrage des cavaliers du disque et la détection au niveau du BIOS, installer les derniers correctifs au niveau de votre système d&apos;exploitation et des gestionnaires de disques.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="469"/>
+ <source>Flags</source>
+ <translation>Drapeaux</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="470"/>
+ <source>Type</source>
+ <translation>Type</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="471"/>
+ <source>File System</source>
+ <translation>Système de fichiers</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="472"/>
+ <source>Size</source>
+ <translation>Taille</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="473"/>
+ <source>Label</source>
+ <translation>Label</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="488"/>
+ <source>File System type</source>
+ <translation>Type de système de fichiers</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="489"/>
+ <source>ext2/ext3/ext4 filesystem</source>
+ <translation>Système de fichier ext2/ext3/ext4</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="490"/>
+ <source>FAT/NTFS/HFS+/ReiserFS/...</source>
+ <translation>FAT/NTFS/HFS+/ReiserFS/...</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="494"/>
+ <source>Free: Scan for file from unallocated space only</source>
+ <translation>Free: Rechercher des fichiers depuis l&apos;espace non alloué uniquement</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="495"/>
+ <source>Whole: Extract files from whole partition</source>
+ <translation>Whole: Extraire les fichiers depuis la totalité de la partition</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="522"/>
+ <source>&amp;Browse</source>
+ <translation>&amp;Parcourir</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="542"/>
+ <source>&amp;File Formats</source>
+ <translation>&amp;Formats de fichier</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="642"/>
+ <source>Destination:</source>
+ <translation>Destination:</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="647"/>
+ <source>Recovery completed</source>
+ <translation>Récupération de données terminée</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="652"/>
+ <source>Bruteforce %1 sectors remaining (test %2)</source>
+ <translation>Force brute %1 secteurs restants (test %2)</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="660"/>
+ <source>Pass %1 - Reading sector %2/%3</source>
+ <translation>Passe %1 - Lecture du secteur %2/%3</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="665"/>
+ <source>%1/10 headers found</source>
+ <translation>%1/10 entêtes trouvés</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="667"/>
+ <source>%1 files found</source>
+ <translation>%1 fichiers trouvés</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="762"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Quitter</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="834"/>
+ <source>QPhotoRec: Failed to create file!</source>
+ <translation>QPhotoRec: Échec de création de fichier!</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="835"/>
+ <source>Failed to create file! Please choose another destination</source>
+ <translation>Impossible de créer un fichier! Merci de sélectionner une autre destination</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="854"/>
+ <source>QPhotoRec: Not enough space!</source>
+ <translation>QPhotoRec: Pas assez d&apos;espace!</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="855"/>
+ <source>There is not enough space left! Please free disk space and/or choose another destination</source>
+ <translation>Il n&apos;y a pas assez d&apos;espace disponible! Merci de libérer de l&apos;espace disque et/ou de choisir une autre destination</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="929"/>
+ <source>QPhotoRec is is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
+
+QPhotoRec is is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with QPhotoRec. If not, see &lt;http://www.gnu.org/licenses/&gt;.</source>
+ <translation>QPhotoRec est un logiciel libre: vous pouvez le redistribuer et/ou le modifier sous les termes de la Licence Publique Générale GNU telle que publiée par la Free Software Foundation ; soit la version 2 de la licence, ou (à votre discrétion) toute version ultérieure.
+
+QPhotoRec est distribué dans l&apos;espoir qu&apos;il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de VALEUR MARCHANDE ou D&apos;ADÉQUATION À UN BESOIN PARTICULIER. Pour plus de détails, voir la Licence Publique Générale GNU.
+
+Vous avez du recevoir un exemplaire de la Licence Publique Générale GNU avec ce programme ; si ce n&apos;est pas le cas, consulter &lt;http://www.gnu.org/licenses/&gt;.</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="930"/>
+ <source>QPhotoRec: About</source>
+ <translation>QPhotoRec: A propos</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="959"/>
+ <source>File Formats</source>
+ <translation>Formats de fichier</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="962"/>
+ <source>&amp;Reset</source>
+ <translation>&amp;Réinitialiser</translation>
+ </message>
+ <message>
+ <location filename="src/qphotorec.cpp" line="963"/>
+ <source>Res&amp;tore</source>
+ <translation>Res&amp;taurer</translation>
+ </message>
+</context>
+</TS> \ No newline at end of file
diff --git a/src/qmainrec.cpp b/src/qmainrec.cpp
index 43b9c94..842ee61 100644
--- a/src/qmainrec.cpp
+++ b/src/qmainrec.cpp
@@ -25,6 +25,7 @@
#endif
#include <QApplication>
+#include <QTranslator>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
@@ -103,8 +104,20 @@ int main(int argc, char *argv[])
}
}
#endif
- QApplication a(argc, argv);
log_handle=log_open("qphotorec.log", TD_LOG_CREATE, &log_errno);
+ QApplication a(argc, argv);
+ QTranslator translator;
+ QString locale = QLocale::system().name().section('_', 0, 0);
+ log_info("%s\n", locale.toStdString().c_str());
+ if(translator.load(QLocale(), "qphotorec", ".", ":lang/", ".qm"))
+ {
+ a.installTranslator(&translator);
+ log_info("translator installed\n");
+ }
+ else
+ {
+ log_info("translator not installed\n");
+ }
#ifdef HAVE_DUP2
if(log_handle)
{
diff --git a/src/qphotorec.cpp b/src/qphotorec.cpp
index f304808..94ac8f9 100644
--- a/src/qphotorec.cpp
+++ b/src/qphotorec.cpp
@@ -153,7 +153,7 @@ QPhotorec::~QPhotorec()
void QPhotorec::setExistingDirectory()
{
QString directory = QFileDialog::getExistingDirectory(this,
- "Please select a destination to save the recovered files to.",
+ tr("Please select a destination to save the recovered files to."),
directoryLabel->text(),
QFileDialog::ShowDirsOnly);
if (!directory.isEmpty())
@@ -167,9 +167,9 @@ void QPhotorec::newSourceFile()
{
const int testdisk_mode=TESTDISK_O_RDONLY|TESTDISK_O_READAHEAD_32K;
QString filename = QFileDialog::getOpenFileName(this,
- "Please select a raw file",
+ tr("Please select a raw file"),
"",
- "Raw Files (*.dd *.raw *.img)");
+ tr("Raw Files (*.dd *.raw *.img)"));
if(!filename.isEmpty())
{
disk_t *new_disk=NULL;
@@ -256,9 +256,9 @@ void QPhotorec::PartListWidget_updateUI()
if(arch->get_partition_typename(partition)!=NULL)
PartListWidget->setItem(currentRow, 2, new QTableWidgetItem(QString(arch->get_partition_typename(partition))));
else if(arch->get_part_type)
- PartListWidget->setItem(currentRow, 2, new QTableWidgetItem("Sys=" + QString::number(arch->get_part_type(partition))));
+ PartListWidget->setItem(currentRow, 2, new QTableWidgetItem(tr("Sys=") + QString::number(arch->get_part_type(partition))));
else
- PartListWidget->setItem(currentRow, 2, new QTableWidgetItem("Unknown"));
+ PartListWidget->setItem(currentRow, 2, new QTableWidgetItem(tr("Unknown")));
if(partition->upart_type>0)
{
QTableWidgetItem *item=new QTableWidgetItem(QString(arch_none.get_partition_typename(partition)));
@@ -373,24 +373,24 @@ QWidget *QPhotorec::copyright(QWidget * qwparent)
/* TODO replace by a warning */
int QPhotorec::no_disk_warning()
{
- const char *msg;
- msg="No harddisk found";
+ QString msg;
+ msg=tr("No harddisk found");
#if defined(__CYGWIN__) || defined(__MINGW32__)
- msg="No harddisk found\n"
+ msg=tr("No harddisk found\n"
"You need to be administrator to use this program.\n"
"Under Win9x, use the DOS version instead.\n"
- "Under Vista or later, select this program, right-click and choose \"Run as administrator\".";
+ "Under Vista or later, select this program, right-click and choose \"Run as administrator\".");
#elif defined(DJGPP)
#else
#ifdef HAVE_GETEUID
if(geteuid()!=0)
{
- msg="No harddisk found\n"
- "You need to be root to use PhotoRec.";
+ msg=tr("No harddisk found\n"
+ "You need to be root to use PhotoRec.");
}
#endif
#endif
- return QMessageBox::warning(this,"No Disk!", msg, QMessageBox::Ok);
+ return QMessageBox::warning(this,tr("No Disk!"), msg, QMessageBox::Ok);
}
void QPhotorec::buttons_updateUI()
@@ -449,28 +449,28 @@ void QPhotorec::HDDlistWidget_updateUI()
}
HDDlistWidget->addItem(
QIcon::fromTheme("application-x-cd-image", QIcon(":res/gnome/application-x-cd-image.png")),
- "Add a raw disk image...");
+ tr("Add a raw disk image..."));
}
void QPhotorec::setupUI()
{
QWidget *t_copy = copyright(this);
- QLabel *t_free_soft = new QLabel("PhotoRec is free software, and comes with ABSOLUTELY NO WARRANTY.");
- QLabel *t_select = new QLabel("Please select a media to recover from");
+ QLabel *t_free_soft = new QLabel(tr("PhotoRec is free software, and comes with ABSOLUTELY NO WARRANTY."));
+ QLabel *t_select = new QLabel(tr("Please select a media to recover from"));
HDDlistWidget = new QComboBox();
- HDDlistWidget->setToolTip("Disk capacity must be correctly detected for a successful recovery.\n"
+ HDDlistWidget->setToolTip(tr("Disk capacity must be correctly detected for a successful recovery.\n"
"If a disk listed above has an incorrect size, check HD jumper settings and BIOS\n"
- "detection, and install the latest OS patches and disk drivers."
+ "detection, and install the latest OS patches and disk drivers.")
);
QStringList oLabel;
oLabel.append("");
- oLabel.append("Flags");
- oLabel.append("Type");
- oLabel.append("File System");
- oLabel.append("Size");
- oLabel.append("Label");
+ oLabel.append(tr("Flags"));
+ oLabel.append(tr("Type"));
+ oLabel.append(tr("File System"));
+ oLabel.append(tr("Size"));
+ oLabel.append(tr("Label"));
PartListWidget= new QTableWidget();
PartListWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
@@ -485,14 +485,14 @@ void QPhotorec::setupUI()
QGroupBox *groupBox1;
QGroupBox *groupBox2;
- groupBox1 = new QGroupBox("File System type");
- qextRadioButton = new QRadioButton("ext2/ext3/ext4 filesystem");
- qfatRadioButton = new QRadioButton("FAT/NTFS/HFS+/ReiserFS/...");
+ groupBox1 = new QGroupBox(tr("File System type"));
+ qextRadioButton = new QRadioButton(tr("ext2/ext3/ext4 filesystem"));
+ qfatRadioButton = new QRadioButton(tr("FAT/NTFS/HFS+/ReiserFS/..."));
qfatRadioButton->setChecked(true);
groupBox2 = new QGroupBox();
- qfreeRadioButton = new QRadioButton("Free: Scan for file from unallocated space only");
- qwholeRadioButton = new QRadioButton("Whole: Extract files from whole partition");
+ qfreeRadioButton = new QRadioButton(tr("Free: Scan for file from unallocated space only"));
+ qwholeRadioButton = new QRadioButton(tr("Whole: Extract files from whole partition"));
qfreeRadioButton->setEnabled(false);
qwholeRadioButton->setChecked(true);
@@ -515,11 +515,11 @@ void QPhotorec::setupUI()
groupBox->setLayout(groupBoxLayout);
- QLabel *dstWidget= new QLabel("Please select a destination to save the recovered files to.");
+ QLabel *dstWidget= new QLabel(tr("Please select a destination to save the recovered files to."));
directoryLabel=new QLineEdit("");
QPushButton *dst_button = new QPushButton(
QIcon::fromTheme("folder", QIcon(":res/gnome/folder.png")),
- "&Browse");
+ tr("&Browse"));
QWidget *dst_widget= new QWidget(this);
QWidget *dst_widget2= new QWidget(this);
@@ -539,7 +539,7 @@ void QPhotorec::setupUI()
button_search->setEnabled(false);
QPushButton *button_quit= new QPushButton(QIcon::fromTheme("application-exit", QIcon(":res/gnome/application-exit.png")), "&Quit");
QPushButton *button_about= new QPushButton(QIcon::fromTheme("help-about", QIcon(":res/gnome/help-about.png")), "&About");
- QPushButton *button_formats= new QPushButton(QIcon::fromTheme("image-x-generic.png", QIcon(":res/gnome/image-x-generic.png")),"&File Formats");
+ QPushButton *button_formats= new QPushButton(QIcon::fromTheme("image-x-generic.png", QIcon(":res/gnome/image-x-generic.png")),tr("&File Formats"));
QWidget *B_widget = new QWidget(this);
QHBoxLayout *B_layout = new QHBoxLayout(B_widget);
@@ -639,34 +639,32 @@ void QPhotorec::qphotorec_search_updateUI()
const unsigned int sector_size=params->disk->sector_size;
QString tmp;
QString txt = QString(directoryLabel->text()).toHtmlEscaped();
- folder_txt->setText("Destination: <a href=\"file://" + txt + "/" +
+ folder_txt->setText(tr("Destination:")+" <a href=\"file://" + txt + "/" +
DEFAULT_RECUP_DIR + "." + QString::number(params->dir_num) + "\">" +
txt + "</a>");
if(params->status==STATUS_QUIT)
{
- tmp.sprintf("Recovery completed");
+ tmp=QString(tr("Recovery completed"));
}
else if(params->status==STATUS_EXT2_ON_BF || params->status==STATUS_EXT2_OFF_BF)
{
- tmp.sprintf("Bruteforce %10lu sectors remaining (test %u)",
- (unsigned long)((params->offset-partition->part_offset)/sector_size),
- params->pass);
+ const unsigned long sectors_remaining=(params->offset-partition->part_offset)/sector_size;
+ tmp=QString(tr("Bruteforce %1 sectors remaining (test %2)").arg(sectors_remaining).arg(params->pass));
}
else
{
- tmp.sprintf("Pass %u - Reading sector %10llu/%llu",
- params->pass,
- (unsigned long long)(params->offset>partition->part_offset && params->offset < partition->part_size ?
- ((params->offset-partition->part_offset)/sector_size):
- 0),
- (unsigned long long)(partition->part_size/sector_size));
+ const unsigned long long sector_current=(params->offset>partition->part_offset && params->offset < partition->part_size ?
+ ((params->offset-partition->part_offset)/sector_size):
+ 0);
+ const unsigned long long sector_total=partition->part_size/sector_size;
+ tmp=QString(tr("Pass %1 - Reading sector %2/%3").arg(params->pass).arg(sector_current).arg(sector_total));
}
progress_info->setText(tmp);
if(params->status==STATUS_FIND_OFFSET)
- tmp.sprintf("%u/10 headers found", params->file_nbr);
+ tmp=QString(tr("%1/10 headers found").arg(params->file_nbr));
else
- tmp.sprintf("%u files found", params->file_nbr);
+ tmp=QString(tr("%1 files found").arg(params->file_nbr));
progress_filefound->setText(tmp);
if(params->status==STATUS_QUIT)
@@ -761,7 +759,7 @@ void QPhotorec::qphotorec_search_setupUI()
filestatsWidget->setHorizontalHeaderLabels( oLabel );
filestatsWidget->resizeColumnsToContents();
- QPushButton *button_quit= new QPushButton(QIcon::fromTheme("application-exit", QIcon(":res/gnome/application-exit.png")), "&Quit");
+ QPushButton *button_quit= new QPushButton(QIcon::fromTheme("application-exit", QIcon(":res/gnome/application-exit.png")), tr("&Quit"));
mainLayout->addWidget(t_copy);
mainLayout->addWidget(diskWidget);
mainLayout->addWidget(folderWidget);
@@ -832,7 +830,10 @@ int QPhotorec::photorec(alloc_data_t *list_search_space)
{
case PSTATUS_EACCES:
{
- int ret=QMessageBox::warning(this,"QPhotoRec: Failed to create file!", "Failed to create file! Please choose another destination", QMessageBox::Ok| QMessageBox::Cancel, QMessageBox::Ok);
+ int ret=QMessageBox::warning(this,
+ tr("QPhotoRec: Failed to create file!"),
+ tr("Failed to create file! Please choose another destination"),
+ QMessageBox::Ok| QMessageBox::Cancel, QMessageBox::Ok);
if(ret==QMessageBox::Cancel)
{
params->status=STATUS_QUIT;
@@ -849,7 +850,10 @@ int QPhotorec::photorec(alloc_data_t *list_search_space)
break;
case PSTATUS_ENOSPC:
{
- int ret=QMessageBox::warning(this,"QPhotoRec: Not enough space!", "There is not enough space left! Please free disk space and/or choose another destination", QMessageBox::Ok| QMessageBox::Cancel, QMessageBox::Ok);
+ int ret=QMessageBox::warning(this,
+ tr("QPhotoRec: Not enough space!"),
+ tr("There is not enough space left! Please free disk space and/or choose another destination"),
+ QMessageBox::Ok| QMessageBox::Cancel, QMessageBox::Ok);
if(ret==QMessageBox::Cancel)
{
params->status=STATUS_QUIT;
@@ -888,7 +892,11 @@ void QPhotorec::qphotorec_search()
if(selected_disk==NULL || selected_partition==NULL)
return;
static alloc_data_t list_search_space={
- .list = TD_LIST_HEAD_INIT(list_search_space.list)
+ .list = TD_LIST_HEAD_INIT(list_search_space.list),
+ .start=0,
+ .end=0,
+ .file_stat=NULL,
+ .data=0
};
QByteArray byteArray = (directoryLabel->text() + "/" + DEFAULT_RECUP_DIR).toUtf8();
@@ -918,8 +926,8 @@ void QPhotorec::qphotorec_about()
{
QPixmap pixmap_img = QPixmap(":res/photorec_64x64.png");
QMessageBox msg;
- msg.setText("QPhotoRec is is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.\n\nQPhotoRec is is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with QPhotoRec. If not, see <http://www.gnu.org/licenses/>.");
- msg.setWindowTitle("QPhotoRec: About");
+ msg.setText(tr("QPhotoRec is is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.\n\nQPhotoRec is is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with QPhotoRec. If not, see <http://www.gnu.org/licenses/>."));
+ msg.setWindowTitle(tr("QPhotoRec: About"));
msg.addButton(QMessageBox::Close);
msg.setIconPixmap(pixmap_img);
msg.exec();
@@ -948,11 +956,11 @@ void QPhotorec::qphotorec_formats()
}
QDialog fenetre3;
- fenetre3.setWindowTitle("QPhotoRec: File Formats");
+ fenetre3.setWindowTitle("QPhotoRec: "+tr("File Formats"));
QDialogButtonBox buttonBox(Qt::Horizontal);
- QPushButton *bt_reset= new QPushButton("&Reset");
- QPushButton *bt_restore= new QPushButton("Res&tore");
+ QPushButton *bt_reset= new QPushButton(tr("&Reset"));
+ QPushButton *bt_restore= new QPushButton(tr("Res&tore"));
buttonBox.addButton(bt_reset, QDialogButtonBox::ResetRole);
buttonBox.addButton(bt_restore, QDialogButtonBox::ResetRole);
diff --git a/src/qphotorec_locale.qrc b/src/qphotorec_locale.qrc
new file mode 100644
index 0000000..51856b6
--- /dev/null
+++ b/src/qphotorec_locale.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file>lang/qphotorec.fr.qm</file>
+</qresource>
+</RCC>
+