i18n, initial translation to Swedish

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34050 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2009-11-15 01:42:47 +00:00
parent fe9ca3bd8e
commit e2fe56d7d4
6 changed files with 89 additions and 38 deletions
@@ -0,0 +1,18 @@
1 svenska x-vnd.haiku.zip-o-matic 274748138
1 file added. file:ZipOMaticWindow.cpp 1 fil tillagd.
Stop file:ZipOMaticWindow.cpp Avbryt
Creating archive: %s file:ZipOMaticWindow.cpp Skapar fil: %s
Continue file:ZipOMaticWindow.cpp Fortsätt
Preparing to archive file:ZipperThread.cpp Förbereder...
Filename: %s file:ZipOMaticWindow.cpp Filnamn: %s
Let them continue file:ZipOMatic.cpp Låt dem fortsätta
Do you want to stop them? file:ZipOMatic.cpp Vill du avbryta dem?
Are you sure you want to stop creating this archive? file:ZipOMaticWindow.cpp Vill du avbryta skapandet av den här filen?
%ld files added. file:ZipOMaticWindow.cpp %ld filer tillagda.
Stopped file:ZipOMaticWindow.cpp Avbruten
Archive file:ZipperThread.cpp Arkiv
Drop files to zip. file:ZipOMaticWindow.cpp Släpp filer här för att zippa dem.
Error creating archive file:ZipOMaticWindow.cpp Något gick snett.
You have %ld Zip-O-Matic running.\n\n file:ZipOMatic.cpp %ld Zip-O-Matic är igång.\n\n
Archive created OK file:ZipOMaticWindow.cpp Zipfil skapad utan problem.
Stop them file:ZipOMatic.cpp Avbryt dem
+12 -1
View File
@@ -9,6 +9,17 @@ Application ZipOMatic-Z :
ZipOMaticWindow.cpp ZipOMaticWindow.cpp
ZipperThread.cpp ZipperThread.cpp
: be tracker $(TARGET_LIBSUPC++) : be tracker $(TARGET_LIBSUPC++) liblocale.so
: ZipOMatic.rdef : ZipOMatic.rdef
; ;
DoCatalogs ZipOMatic-Z :
x-vnd.haiku.zip-o-matic
:
ZipOMatic.cpp
ZipOMaticWindow.cpp
ZipperThread.cpp
: en.catalog
: sv.catkeys
;
+12 -4
View File
@@ -17,6 +17,9 @@
#include "ZipOMaticWindow.h" #include "ZipOMaticWindow.h"
#define TR_CONTEXT "file:ZipOMatic.cpp"
int int
main() main()
{ {
@@ -33,6 +36,7 @@ ZipOMatic::ZipOMatic()
fGotRefs(false), fGotRefs(false),
fInvoker(new BInvoker(new BMessage(ZIPPO_QUIT_OR_CONTINUE), NULL, this)) fInvoker(new BInvoker(new BMessage(ZIPPO_QUIT_OR_CONTINUE), NULL, this))
{ {
be_locale->GetAppCatalog(&fCatalog);
} }
@@ -149,11 +153,15 @@ ZipOMatic::QuitRequested(void)
// in that zippers are not paused while the BAlert is up. // in that zippers are not paused while the BAlert is up.
BString question; BString question;
question << "You have " << zippoCount; question << TR("You have %ld Zip-O-Matic running.\n\n");
question << " Zip-O-Matic running.\n\nDo you want to stop them?"; question << TR("Do you want to stop them?");
BString temp;
temp << zippoCount;
question.ReplaceFirst("%ld", temp.String());
BAlert* alert = new BAlert("Stop or Continue", question.String(), BAlert* alert = new BAlert(NULL, question.String(),
"Stop them", "Let them continue", NULL, B_WIDTH_AS_USUAL, TR("Stop them"), TR("Let them continue"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT); B_WARNING_ALERT);
alert->Go(fInvoker); alert->Go(fInvoker);
alert->Activate(); alert->Activate();
@@ -3,7 +3,9 @@
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Invoker.h> #include <Invoker.h>
#include <Locale.h>
#include <Message.h> #include <Message.h>
@@ -26,6 +28,8 @@ private:
bool fGotRefs; bool fGotRefs;
BInvoker* fInvoker; BInvoker* fInvoker;
BCatalog fCatalog;
}; };
#endif // _ZIPOMATIC_H_ #endif // _ZIPOMATIC_H_
@@ -14,11 +14,13 @@
#include <Alert.h> #include <Alert.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Directory.h> #include <Directory.h>
#include <File.h> #include <File.h>
#include <FindDirectory.h> #include <FindDirectory.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <LayoutBuilder.h> #include <LayoutBuilder.h>
#include <Locale.h>
#include <Path.h> #include <Path.h>
#include <Roster.h> #include <Roster.h>
#include <Screen.h> #include <Screen.h>
@@ -31,6 +33,9 @@
#include "ZipperThread.h" #include "ZipperThread.h"
#define TR_CONTEXT "file:ZipOMaticWindow.cpp"
ZippoWindow::ZippoWindow(BList windowList, bool keepOpen) ZippoWindow::ZippoWindow(BList windowList, bool keepOpen)
: :
BWindow(BRect(0, 0, 0, 0), "Zip-O-Matic", B_TITLED_WINDOW, BWindow(BRect(0, 0, 0, 0), "Zip-O-Matic", B_TITLED_WINDOW,
@@ -50,11 +55,11 @@ ZippoWindow::ZippoWindow(BList windowList, bool keepOpen)
fArchiveNameView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, fArchiveNameView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_UNSET)); B_ALIGN_VERTICAL_UNSET));
fZipOutputView = new BStringView("output_text", "Drop files to zip."); fZipOutputView = new BStringView("output_text", TR("Drop files to zip."));
fZipOutputView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, fZipOutputView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_UNSET)); B_ALIGN_VERTICAL_UNSET));
fStopButton = new BButton("stop", "Stop", new BMessage(B_QUIT_REQUESTED)); fStopButton = new BButton("stop", TR("Stop"), new BMessage(B_QUIT_REQUESTED));
fStopButton->SetEnabled(false); fStopButton->SetEnabled(false);
fStopButton->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, fStopButton->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT,
B_ALIGN_VERTICAL_UNSET)); B_ALIGN_VERTICAL_UNSET));
@@ -102,9 +107,9 @@ ZippoWindow::MessageReceived(BMessage* message)
fStopButton->SetEnabled(false); fStopButton->SetEnabled(false);
fArchiveNameView->SetText(" "); fArchiveNameView->SetText(" ");
if (fZippingWasStopped) if (fZippingWasStopped)
fZipOutputView->SetText("Stopped"); fZipOutputView->SetText(TR("Stopped"));
else else
fZipOutputView->SetText("Archive created OK"); fZipOutputView->SetText(TR("Archive created OK"));
_CloseWindowOrKeepOpen(); _CloseWindowOrKeepOpen();
break; break;
@@ -115,16 +120,17 @@ ZippoWindow::MessageReceived(BMessage* message)
fActivityView->Stop(); fActivityView->Stop();
fStopButton->SetEnabled(false); fStopButton->SetEnabled(false);
fArchiveNameView->SetText(""); fArchiveNameView->SetText("");
fZipOutputView->SetText("Error creating archive"); fZipOutputView->SetText(TR("Error creating archive"));
break; break;
case ZIPPO_TASK_DESCRIPTION: case ZIPPO_TASK_DESCRIPTION:
{ {
BString string; BString filename;
if (message->FindString("archive_filename", &string) == B_OK) { if (message->FindString("archive_filename", &filename) == B_OK) {
fArchiveName = string; fArchiveName = filename;
string.Prepend("Creating archive: "); BString temp(TR("Creating archive: %s"));
fArchiveNameView->SetText(string.String()); temp.ReplaceFirst("%s", filename.String());
fArchiveNameView->SetText(temp.String());
} }
break; break;
} }
@@ -133,8 +139,7 @@ ZippoWindow::MessageReceived(BMessage* message)
{ {
BString string; BString string;
if (message->FindString("zip_output", &string) == B_OK) { if (message->FindString("zip_output", &string) == B_OK) {
if (string.FindFirst("Adding: ") == 0 if (string.FindFirst("Adding: ") == 0) {
|| string.FindFirst("Updating: ") == 0) {
// This is a workaround for the current window resizing // This is a workaround for the current window resizing
// behavior as the window resizes for each line of output. // behavior as the window resizes for each line of output.
@@ -143,22 +148,19 @@ ZippoWindow::MessageReceived(BMessage* message)
// being created (added to) or if we're updating an // being created (added to) or if we're updating an
// already existing archive. // already existing archive.
BString output;
fFileCount++; fFileCount++;
BString countString; BString count;
countString << fFileCount; count << fFileCount;
if (fFileCount == 1) if (fFileCount == 1) {
countString << " file"; output << TR("1 file added.");
else } else {
countString << " files"; output << TR("%ld files added.");
output.ReplaceFirst("%ld", count.String());
}
if (string.FindFirst("Adding: ") == 0) fZipOutputView->SetText(output.String());
countString << " added.";
if (string.FindFirst("Updating: ") == 0)
countString << " updated.";
fZipOutputView->SetText(countString.String());
} else { } else {
fZipOutputView->SetText(string.String()); fZipOutputView->SetText(string.String());
} }
@@ -202,11 +204,14 @@ ZippoWindow::QuitRequested()
fActivityView->Pause(); fActivityView->Pause();
BString message; BString message;
message << "Are you sure you want to stop creating this archive?\n\n"; message << TR("Are you sure you want to stop creating this archive?");
message << "Filename: " << fArchiveName.String() << "\n"; message << "\n\n";
message << TR("Filename: %s");
message << "\n";
message.ReplaceFirst("%s", fArchiveName.String());
BAlert* alert = new BAlert(NULL, message.String(), "Stop", BAlert* alert = new BAlert(NULL, message.String(), TR("Stop"),
"Continue", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); TR("Continue"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go(fWindowInvoker); alert->Go(fWindowInvoker);
return false; return false;
@@ -244,7 +249,7 @@ ZippoWindow::StopZipping()
fThread = NULL; fThread = NULL;
fArchiveNameView->SetText(" "); fArchiveNameView->SetText(" ");
fZipOutputView->SetText("Stopped"); fZipOutputView->SetText(TR("Stopped"));
_CloseWindowOrKeepOpen(); _CloseWindowOrKeepOpen();
} }
@@ -15,7 +15,9 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <FindDirectory.h> #include <Catalog.h>
#include <FindDirectory.h>
#include <Locale.h>
#include <Locker.h> #include <Locker.h>
#include <Message.h> #include <Message.h>
#include <Path.h> #include <Path.h>
@@ -25,6 +27,9 @@
#include "ZipOMaticWindow.h" #include "ZipOMaticWindow.h"
#define TR_CONTEXT "file:ZipperThread.cpp"
ZipperThread::ZipperThread(BMessage* refsMessage, BWindow* window) ZipperThread::ZipperThread(BMessage* refsMessage, BWindow* window)
: :
GenericThread("ZipperThread", B_NORMAL_PRIORITY, refsMessage), GenericThread("ZipperThread", B_NORMAL_PRIORITY, refsMessage),
@@ -107,7 +112,7 @@ ZipperThread::ThreadStartup()
BString archiveName; BString archiveName;
if (refCount > 1) if (refCount > 1)
archiveName = "Archive"; archiveName = TR("Archive");
else else
archiveName = lastRef.name; archiveName = lastRef.name;
@@ -165,7 +170,7 @@ ZipperThread::ThreadStartup()
_SendMessageToWindow(ZIPPO_TASK_DESCRIPTION, "archive_filename", _SendMessageToWindow(ZIPPO_TASK_DESCRIPTION, "archive_filename",
archiveName.String()); archiveName.String());
_SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output", _SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output",
"Preparing to archive"); TR("Preparing to archive"));
return B_OK; return B_OK;
} }