Author: aljen Date: 2010-02-09 13:35:31 +0100 (Tue, 09 Feb 2010) New Revision: 35439 Changeset: http://dev.haiku-os.org/changeset/35439/haiku Added: haiku/trunk/data/catalogs/apps/aboutsystem/ haiku/trunk/data/catalogs/apps/aboutsystem/pl.catkeys Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp haiku/trunk/src/apps/aboutsystem/Jamfile haiku/trunk/src/apps/aboutsystem/Utilities.cpp Log: * Localized AboutSystem * Added polish translation made by me * Added myself & Hubert Hare?\197?\132czyk to polish translators * Corrected my last name * Honor 80lines * Style cleanup Added: haiku/trunk/data/catalogs/apps/aboutsystem/pl.catkeys =================================================================== --- haiku/trunk/data/catalogs/apps/aboutsystem/pl.catkeys (rev 0) +++ haiku/trunk/data/catalogs/apps/aboutsystem/pl.catkeys 2010-02-09 12:35:31 UTC (rev 35439) @@ -0,0 +1,61 @@ +1 polish x-vnd.Haiku-About 620382499 +Travis Geiselbrecht (and his NewOS kernel)\n AboutView Travis Geiselbrecht (i jego kernela NewOS)\n +%ld Processors: AboutView Liczba procesorów %ld: +Michael Phipps (project founder)\n\n AboutView Michael Phipps (fundatora projektu)\n\n +The Haiku-Ports team\n AboutView Zespółu Haiku-Ports\n +Website, marketing & documentation:\n AboutView Strona WWW, marketing i dokumentacja:\n +%s%lld hour AboutView %s%lld godzina +... and the many community members making donations!\n\n AboutView … i wielu innych członków społeczności robiących dotację!\n\n +\nPolish\n\n AboutView \nPolski\n\n +\nJapanese\n\n AboutView \nJapoński\n\n +\nFinnish\n\n AboutView \nFiński\n\n +Revision AboutView Rewizja +\nDutch\n\n AboutView \nHoldenderski\n\n +Source Code: AboutView Kod źródłowy: +Processor: AboutView Procesor: +Kernel: AboutView Kernel: +%lld day AboutView %lld dni +\nHungarian\n\n AboutView \nWęgierski\n\n +\nGerman\n\n AboutView \nNiemiecki\n\n +Contributors:\n AboutView Współpracownicy:\n +Unknown AboutView Nieznany +\nBulgarian\n\n AboutView \nBułgarski\n\n +\nPortuguese\n\n AboutView \nPortugalski\n\n +%s%lld minute AboutView %s%lld minuta +\n… and probably some more we forgot to mention (sorry!)\n\n AboutView \n… i prawdopodobnie paru innych, o których zapomnieliśmy wspomnieć (przepraszamy!)\n\n +%.2f GHz AboutView %.2f GHz +The BeGeistert team\n\n AboutView Zespółu BeGeistert\n\n +%s%lld minutes AboutView %s%lld minuty +Memory: AboutView Pamięć: +%s%lld second AboutView %s%lld sekunda +Past maintainers:\n AboutView Wcześniejsi współpracownicy:\n +The code that is unique to Haiku, especially the kernel and all code that applications may link against, is distributed under the terms of the AboutView Kod źródłowy unikalny dla Haiku, szczególnie jądra systemu i aplikacji z nim rozprowadzanych, dystrybuowany jest pod warunkami +\n\nSpecial thanks to:\n AboutView \n\nSpecjalne podziękowania dla:\n +Copyright Utilities Prawa autorskie +Licenses: AboutView Licencje: +. Some system libraries contain third party code distributed under the LGPL license. You can find the copyrights to third party code below.\n\n AboutView . Niektóre biblioteki systemowe zawieraja oprogramowanie objęte licencją LGPL. Prawa autorskie do nich można znaleźć poniżej.\n\n +%s%lld seconds AboutView %s%lld sekundy +License Utilities Licencja +\nCopyrights\n\n AboutView \nPrawa autorskie\n\n +\nUkrainian\n\n AboutView \nUkraiński\n\n +\nLituanian\n\n AboutView \nLitewski\n\n +Current maintainers:\n AboutView Obecni wspołpracownicy:\n +Time running: AboutView Czas działania: +MIT license AboutView licencji MIT +%s%lld hours AboutView %s%lld godzin +%lld days AboutView %lld dni +The Haikuware team and their bounty program\n AboutView Zespółu Haikuware i ich program bounty\n +About this system AboutWindow O systemie +Version: AboutView Wersja: +\nRussian\n\n AboutView \nRosyjski\n\n +\nItalian\n\n AboutView \nWłoski\n\n +SourceURL Utilities Adres źródłowy +\nFrench\n\n AboutView \nFrancuski\n\n +\nEsperanto\n\n AboutView \nEsperanto\n\n +\nSwedish\n\n AboutView \nSzwedzki\n\n +%ld MHz AboutView %ld MHz +The copyright to the Haiku code is property of Haiku, Inc. or of the respective authors where expressly noted in the source.\n\n AboutView Prawa autorskie kodu źródłowego Haiku są własnością Haiku, Inc. lub autorów wymienionych w kodzie źródłowym..\n\n +[Click a license name to read the respective license.]\n\n AboutView [Kliknij nazwę licencji, aby ją przeczytać.]\n\n +%d MB total, %d MB used (%d%%) AboutView %d MB łącznie, %d MB użyte (%d%%) +License: AboutView Licencja: +Translations:\n AboutView Tłumaczenia na język:\n Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2010-02-09 06:43:37 UTC (rev 35438) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2010-02-09 12:35:31 UTC (rev 35439) @@ -45,6 +45,9 @@ #include <AutoDeleter.h> #include <cpu_type.h> +#include <Catalog.h> +#include <Locale.h> + #include "HyperTextActions.h" #include "HyperTextView.h" #include "Utilities.h" @@ -68,22 +71,27 @@ static const rgb_color kLinkBlue = { 80, 80, 200, 255 }; + class AboutApp : public BApplication { public: - AboutApp(); + AboutApp(); +private: + BCatalog fCatalog; }; + class AboutWindow : public BWindow { public: - AboutWindow(); + AboutWindow(); virtual bool QuitRequested(); }; + class LogoView : public BView { public: - LogoView(); - virtual ~LogoView(); + LogoView(); + virtual ~LogoView(); virtual BSize MinSize(); virtual BSize MaxSize(); @@ -91,14 +99,16 @@ virtual void Draw(BRect updateRect); private: - BBitmap* fLogo; + BBitmap* fLogo; }; + class CropView : public BView { public: - CropView(BView* target, int32 left, int32 top, - int32 right, int32 bottom); - virtual ~CropView(); + CropView(BView* target, int32 left, + int32 top, int32 right, + int32 bottom); + virtual ~CropView(); virtual BSize MinSize(); virtual BSize MaxSize(); @@ -106,17 +116,18 @@ virtual void DoLayout(); private: - BView* fTarget; - int32 fCropLeft; - int32 fCropTop; - int32 fCropRight; - int32 fCropBottom; + BView* fTarget; + int32 fCropLeft; + int32 fCropTop; + int32 fCropRight; + int32 fCropBottom; }; + class AboutView : public BView { public: - AboutView(); - ~AboutView(); + AboutView(); + ~AboutView(); virtual void AttachedToWindow(); virtual void Pulse(); @@ -124,36 +135,36 @@ virtual void MessageReceived(BMessage* msg); virtual void MouseDown(BPoint point); - void AddCopyrightEntry(const char* name, - const char* text, - const StringVector& licenses, - const StringVector& sources, - const char* url); - void AddCopyrightEntry(const char* name, - const char* text, const char* url = NULL); - void PickRandomHaiku(); + void AddCopyrightEntry(const char* name, + const char* text, + const StringVector& licenses, + const StringVector& sources, + const char* url); + void AddCopyrightEntry(const char* name, + const char* text, + const char* url = NULL); + void PickRandomHaiku(); - private: typedef std::map<std::string, PackageCredit*> PackageCreditMap; private: - BView* _CreateLabel(const char* name, const char* label); - BView* _CreateCreditsView(); - status_t _GetLicensePath(const char* license, - BPath& path); - void _AddCopyrightsFromAttribute(); - void _AddPackageCredit(const PackageCredit& package); - void _AddPackageCreditEntries(); + BView* _CreateLabel(const char* name, const char* label); + BView* _CreateCreditsView(); + status_t _GetLicensePath(const char* license, + BPath& path); + void _AddCopyrightsFromAttribute(); + void _AddPackageCredit(const PackageCredit& package); + void _AddPackageCreditEntries(); BStringView* fMemView; - BTextView* fUptimeView; - BView* fInfoView; + BTextView* fUptimeView; + BView* fInfoView; HyperTextView* fCreditsView; - BBitmap* fLogo; + BBitmap* fLogo; - bigtime_t fLastActionTime; + bigtime_t fLastActionTime; BMessageRunner* fScrollRunner; PackageCreditMap fPackageCredits; }; @@ -165,17 +176,22 @@ AboutApp::AboutApp() : BApplication("application/x-vnd.Haiku-About") { - AboutWindow* window = new AboutWindow(); - window->Show(); + be_locale->GetAppCatalog(&fCatalog); + AboutWindow *window = new(std::nothrow) AboutWindow(); + if (window) + window->Show(); } // #pragma mark - +#undef TR_CONTEXT +#define TR_CONTEXT "AboutWindow" + AboutWindow::AboutWindow() - : BWindow(BRect(0, 0, 500, 300), "About this system", B_TITLED_WINDOW, - B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE) + : BWindow(BRect(0, 0, 500, 300), TR("About this system"), + B_TITLED_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE) { SetLayout(new BGroupLayout(B_VERTICAL)); AddChild(new AboutView()); @@ -185,8 +201,7 @@ ResizeTo(max_c(size.width, Bounds().Width()), max_c(size.height, Bounds().Height())); - MoveTo((BScreen().Frame().Width() - Bounds().Width()) / 2, - (BScreen().Frame().Height() - Bounds().Height()) / 2 ); + CenterOnScreen(); } @@ -314,6 +329,8 @@ // #pragma mark - AboutView +#undef TR_CONTEXT +#define TR_CONTEXT "AboutView" AboutView::AboutView() : BView("aboutview", B_WILL_DRAW | B_PULSE_NEEDED), @@ -330,7 +347,7 @@ // OS Version char string[1024]; - strcpy(string, "Unknown"); + strcpy(string, TR("Unknown")); // the version is stored in the BEOS:APP_VERSION attribute of libbe.so BPath path; @@ -355,7 +372,9 @@ if (sscanf(unameInfo.version, "r%ld", &revision) == 1) { char version[16]; snprintf(version, sizeof(version), "%ld", revision); - strlcat(string, " (Revision ", sizeof(string)); + strlcat(string, " (", sizeof(string)); + strlcat(string, TR("Revision"), sizeof(string)); + strlcat(string, " ", sizeof(string)); strlcat(string, version, sizeof(string)); strlcat(string, ")", sizeof(string)); } @@ -377,10 +396,11 @@ // CPU count, type and clock speed char processorLabel[256]; if (systemInfo.cpu_count > 1) { - snprintf(processorLabel, sizeof(processorLabel), "%ld Processors:", - systemInfo.cpu_count); + snprintf(processorLabel, sizeof(processorLabel), + TR("%ld Processors:"), systemInfo.cpu_count); } else - strlcpy(processorLabel, "Processor:", sizeof(processorLabel)); + strlcpy(processorLabel, TR("Processor:"), + sizeof(processorLabel)); BString cpuType; cpuType << get_cpu_vendor_string(systemInfo.cpu_type) @@ -392,9 +412,9 @@ int32 clockSpeed = get_rounded_cpu_speed(); if (clockSpeed < 1000) - sprintf(string,"%ld MHz", clockSpeed); + sprintf(string, TR("%ld MHz"), clockSpeed); else - sprintf(string,"%.2f GHz", clockSpeed / 1000.0f); + sprintf(string, TR("%.2f GHz"), clockSpeed / 1000.0f); BStringView* frequencyView = new BStringView("frequencytext", string); frequencyView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, @@ -431,7 +451,7 @@ .AddGroup(B_VERTICAL) .Add(new LogoView()) .AddGroup(B_VERTICAL) - .Add(_CreateLabel("oslabel", "Version:")) + .Add(_CreateLabel("oslabel", TR("Version:"))) .Add(versionView) #if __GNUC__ != 2 .Add(gccView) @@ -441,13 +461,14 @@ .Add(cpuView) .Add(frequencyView) .AddStrut(offset) - .Add(_CreateLabel("memlabel", "Memory:")) + .Add(_CreateLabel("memlabel", TR("Memory:"))) .Add(fMemView) .AddStrut(offset) - .Add(_CreateLabel("kernellabel", "Kernel:")) + .Add(_CreateLabel("kernellabel", TR("Kernel:"))) .Add(kernelView) .AddStrut(offset) - .Add(_CreateLabel("uptimelabel", "Time running:")) + .Add(_CreateLabel("uptimelabel", + TR("Time running:"))) .Add(fUptimeView) .SetInsets(5, 5, 5, 5) .End() @@ -502,7 +523,8 @@ fUptimeView->SetText(UptimeToString(string, sizeof(string))); fMemView->SetText(MemUsageToString(string, sizeof(string), &info)); - if (fScrollRunner == NULL && system_time() > fLastActionTime + 10000000) { + if (fScrollRunner == NULL + && system_time() > fLastActionTime + 10000000) { BMessage message(SCROLL_CREDITS_VIEW); //fScrollRunner = new BMessageRunner(this, &message, 25000, -1); } @@ -515,7 +537,8 @@ switch (msg->what) { case SCROLL_CREDITS_VIEW: { - BScrollBar* scrollBar = fCreditsView->ScrollBar(B_VERTICAL); + BScrollBar* scrollBar = + fCreditsView->ScrollBar(B_VERTICAL); if (scrollBar == NULL) break; float max, min; @@ -543,7 +566,8 @@ void AboutView::AddCopyrightEntry(const char* name, const char* text, - const StringVector& licenses, const StringVector& sources, const char* url) + const StringVector& licenses, const StringVector& sources, + const char* url) { BFont font(be_bold_font); //font.SetSize(be_bold_font->Size()); @@ -558,9 +582,9 @@ if (licenses.CountStrings() > 0) { if (licenses.CountStrings() > 1) - fCreditsView->Insert("Licenses: "); + fCreditsView->Insert(TR("Licenses: ")); else - fCreditsView->Insert("License: "); + fCreditsView->Insert(TR("License: ")); for (int32 i = 0; i < licenses.CountStrings(); i++) { const char* license = licenses.StringAt(i); @@ -584,7 +608,7 @@ } if (sources.CountStrings() > 0) { - fCreditsView->Insert("Source Code: "); + fCreditsView->Insert(TR("Source Code: ")); for (int32 i = 0; i < sources.CountStrings(); i++) { const char* source = sources.StringAt(i); @@ -598,7 +622,8 @@ fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kLinkBlue); - fCreditsView->InsertHyperText(urlName, new URLAction(urlAddress)); + fCreditsView->InsertHyperText(urlName, + new URLAction(urlAddress)); } fCreditsView->Insert("\n"); @@ -609,8 +634,10 @@ BString urlAddress; parse_named_url(url, urlName, urlAddress); - fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kLinkBlue); - fCreditsView->InsertHyperText(urlName, new URLAction(urlAddress)); + fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, + &kLinkBlue); + fCreditsView->InsertHyperText(urlName, + new URLAction(urlAddress)); fCreditsView->Insert("\n"); } fCreditsView->Insert("\n"); @@ -714,10 +741,10 @@ fCreditsView->Insert(string); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); - fCreditsView->Insert("The copyright to the Haiku code is property of " + fCreditsView->Insert(TR("The copyright to the Haiku code is property of " "Haiku, Inc. or of the respective authors where expressly noted " "in the source." - "\n\n"); + "\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kLinkBlue); fCreditsView->InsertHyperText("http://www.haiku-os.org";, @@ -728,7 +755,7 @@ font.SetFace(B_BOLD_FACE | B_ITALIC_FACE); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Current maintainers:\n"); + fCreditsView->Insert(TR("Current maintainers:\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( @@ -766,13 +793,13 @@ "Oliver Tappe\n" "Gerasim Troeglazov\n" "Ingo Weinhold\n" - "Artur Wyszynski\n" + "Artur Wyszyński\n" "Clemens Zeidler\n" "Siarzhuk Zharski\n" "\n"); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Past maintainers:\n"); + fCreditsView->Insert(TR("Past maintainers:\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( @@ -799,7 +826,7 @@ "\n"); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Website, marketing & documentation:\n"); + fCreditsView->Insert(TR("Website, marketing & documentation:\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( @@ -814,7 +841,7 @@ "\n"); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Contributors:\n"); + fCreditsView->Insert(TR("Contributors:\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( @@ -894,46 +921,47 @@ "Gerald Zajac\n" "Łukasz Zemczak\n" "JiSheng Zhang\n" - "Zhao Shuai\n" - "\n" B_UTF8_ELLIPSIS " and probably some more we forgot to mention " - "(sorry!)" - "\n\n"); + "Zhao Shuai\n"); + fCreditsView->Insert( + TR("\n" B_UTF8_ELLIPSIS + " and probably some more we forgot to mention (sorry!)" + "\n\n")); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Translations:\n"); + fCreditsView->Insert(TR("Translations:\n")); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nBulgarian\n\n"); + fCreditsView->Insert(TR("\nBulgarian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "cssvb94\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nDutch\n\n"); + fCreditsView->Insert(TR("\nDutch\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Meanwhile\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nEsperanto\n\n"); + fCreditsView->Insert(TR("\nEsperanto\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Travis D. Reed (Dancxjo)\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nFinnish\n\n"); + fCreditsView->Insert(TR("\nFinnish\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Jaakko Leikas (Garjala)\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nFrench\n\n"); + fCreditsView->Insert(TR("\nFrench\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Adrien Destugues (PulkoMandy)\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nGerman\n\n"); + fCreditsView->Insert(TR("\nGerman\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Colin Günther\n" @@ -941,65 +969,72 @@ "leszek\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nHungarian\n\n"); + fCreditsView->Insert(TR("\nHungarian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "miqlas\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nItalian\n\n"); + fCreditsView->Insert(TR("\nItalian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Andrea Bernardi\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nJapanese\n\n"); + fCreditsView->Insert(TR("\nJapanese\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "The JPBE.net user group\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nLituanian\n\n"); + fCreditsView->Insert(TR("\nLituanian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Algirdas Buckus\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nPortuguese\n\n"); + fCreditsView->Insert(TR("\nPolish\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( + "Artur Wyszyński\n" + "Hubert Hareńczyk\n" + ); + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); + fCreditsView->Insert(TR("\nPortuguese\n\n")); + fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); + fCreditsView->Insert( "Marcos Alves (Xeon3D)\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nRussian\n\n"); + fCreditsView->Insert(TR("\nRussian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "StoroZ Gneva\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nSwedish\n\n"); + fCreditsView->Insert(TR("\nSwedish\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Johan Holmberg\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nUkrainian\n\n"); + fCreditsView->Insert(TR("\nUkrainian\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Alex Rudyk (totish)\n" ); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); - fCreditsView->Insert("Special thanks to:\n"); + fCreditsView->Insert(TR("\n\nSpecial thanks to:\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); - fCreditsView->Insert("Travis Geiselbrecht (and his NewOS kernel)\n"); - fCreditsView->Insert("Michael Phipps (project founder)\n\n"); - fCreditsView->Insert("The Haiku-Ports team\n"); - fCreditsView->Insert("The Haikuware team and their bounty program\n"); - fCreditsView->Insert("The BeGeistert team\n\n"); - fCreditsView->Insert("... and the many community members making " - "donations!\n\n"); + fCreditsView->Insert(TR("Travis Geiselbrecht (and his NewOS kernel)\n")); + fCreditsView->Insert(TR("Michael Phipps (project founder)\n\n")); + fCreditsView->Insert(TR("The Haiku-Ports team\n")); + fCreditsView->Insert(TR("The Haikuware team and their bounty program\n")); + fCreditsView->Insert(TR("The BeGeistert team\n\n")); + fCreditsView->Insert(TR("... and the many community members making " + "donations!\n\n")); // copyrights for various projects we use @@ -1009,21 +1044,21 @@ font.SetSize(be_bold_font->Size() + 4); font.SetFace(B_BOLD_FACE); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert("\nCopyrights\n\n"); + fCreditsView->Insert(TR("\nCopyrights\n\n")); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); - fCreditsView->Insert("[Click a license name to read the respective " - "license.]\n\n"); + fCreditsView->Insert(TR("[Click a license name to read the respective " + "license.]\n\n")); // Haiku license - fCreditsView->Insert("The code that is unique to Haiku, especially the " + fCreditsView->Insert(TR("The code that is unique to Haiku, especially the " "kernel and all code that applications may link against, is " - "distributed under the terms of the "); - fCreditsView->InsertHyperText("MIT license", + "distributed under the terms of the ")); + fCreditsView->InsertHyperText(TR("MIT license"), new OpenFileAction(mitPath.Path())); - fCreditsView->Insert(". Some system libraries contain third party code " + fCreditsView->Insert(TR(". Some system libraries contain third party code " "distributed under the LGPL license. You can find the copyrights " - "to third party code below.\n\n"); + "to third party code below.\n\n")); // GNU copyrights AddCopyrightEntry("The GNU Project", @@ -1105,7 +1140,7 @@ // GLUT implementation copyrights _AddPackageCredit(PackageCredit("GLUT") .SetCopyrights(COPYRIGHT_STRING "1994-1997 Mark Kilgard. " - "All rights reserved.", + "All rights reserved.", COPYRIGHT_STRING "1997 Be Inc.", COPYRIGHT_STRING "1999 Jake Hamby.", NULL)); @@ -1115,8 +1150,8 @@ _AddPackageCredit(PackageCredit("BRegion backend (XFree86)") .SetCopyrights(COPYRIGHT_STRING "1987, 1988, 1998 The Open Group.", COPYRIGHT_STRING "1987, 1988 Digital Equipment " - "Corporation, Maynard, Massachusetts.\n" - "All rights reserved.", + "Corporation, Maynard, Massachusetts.\n" + "All rights reserved.", NULL)); // TODO: License! @@ -1135,8 +1170,8 @@ // expat copyrights _AddPackageCredit(PackageCredit("expat") .SetCopyrights(COPYRIGHT_STRING - "1998, 1999, 2000 Thai Open Source " - "Software Center Ltd and Clark Cooper.", + "1998, 1999, 2000 Thai Open Source " + "Software Center Ltd and Clark Cooper.", COPYRIGHT_STRING "2001, 2002, 2003 Expat maintainers.", NULL)); // TODO: License! @@ -1256,7 +1291,7 @@ _AddPackageCredit(PackageCredit("Xiph.org Foundation") .SetCopyrights("libvorbis, libogg, libtheora, libspeex", COPYRIGHT_STRING "1994-2008 Xiph.Org. " - "All rights reserved.", + "All rights reserved.", NULL) .SetURL("http://www.xiph.org";)); // TODO: License! @@ -1483,7 +1518,7 @@ static const char* MemUsageToString(char string[], size_t size, system_info* info) { - snprintf(string, size, "%d MB total, %d MB used (%d%%)", + snprintf(string, size, TR("%d MB total, %d MB used (%d%%)"), int(info->max_pages / 256.0f + 0.5f), int(info->used_pages / 256.0f + 0.5f), int(100 * info->used_pages / info->max_pages)); @@ -1511,25 +1546,47 @@ char* str = string; if (days) { - str += snprintf(str, size, "%lld day%s",days, days > 1 ? "s" : ""); + if (days > 1) { + str += snprintf(str, size, TR("%lld days"), days); + } else { + str += snprintf(str, size, TR("%lld day"), days); + } } if (hours) { - str += snprintf(str, size - strlen(string), "%s%lld hour%s", - str != string ? ", " : "", - hours, hours > 1 ? "s" : ""); + if (hours > 1) { + str += snprintf(str, size - strlen(string), + TR("%s%lld hours"), + str != string ? ", " : "", hours); + } else { + str += snprintf(str, size - strlen(string), + TR("%s%lld hour"), + str != string ? ", " : "", hours); + } } if (minutes) { - str += snprintf(str, size - strlen(string), "%s%lld minute%s", - str != string ? ", " : "", - minutes, minutes > 1 ? "s" : ""); + if (minutes > 1) { + str += snprintf(str, size - strlen(string), + TR("%s%lld minutes"), + str != string ? ", " : "", minutes); + } else { + str += snprintf(str, size - strlen(string), + TR("%s%lld minute"), + str != string ? ", " : "", minutes); + } } if (seconds || str == string) { // Haiku would be well-known to boot very fast. // Let's be ready to handle below minute uptime, zero second included ;-) - str += snprintf(str, size - strlen(string), "%s%lld second%s", - str != string ? ", " : "", - seconds, seconds > 1 ? "s" : ""); + if (seconds > 1) { + str += snprintf(str, size - strlen(string), + TR("%s%lld seconds"), + str != string ? ", " : "", seconds); + } else { + str += snprintf(str, size - strlen(string), + TR("%s%lld second"), + str != string ? ", " : "", seconds); + } } return string; Modified: haiku/trunk/src/apps/aboutsystem/Jamfile =================================================================== --- haiku/trunk/src/apps/aboutsystem/Jamfile 2010-02-09 06:43:37 UTC (rev 35438) +++ haiku/trunk/src/apps/aboutsystem/Jamfile 2010-02-09 12:35:31 UTC (rev 35439) @@ -19,10 +19,19 @@ HyperTextActions.cpp HyperTextView.cpp Utilities.cpp - : $(TARGET_LIBSTDC++) be translation + : $(TARGET_LIBSTDC++) be translation liblocale.so : AboutSystem.rdef ; +DoCatalogs Fonts : + x-vnd.Haiku-About + : + AboutSystem.cpp + Utilities.cpp + : en.catalog + : pl.catkeys + ; + Includes [ FGristFiles AboutSystem.rdef ] : [ FGristFiles "HAIKU logo - black on white - tiny.png" ] ; SEARCH on [ FGristFiles "HAIKU logo - black on white - tiny.png" ] = [ FDirName $(HAIKU_TOP) data artwork ] ; Modified: haiku/trunk/src/apps/aboutsystem/Utilities.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/Utilities.cpp 2010-02-09 06:43:37 UTC (rev 35438) +++ haiku/trunk/src/apps/aboutsystem/Utilities.cpp 2010-02-09 12:35:31 UTC (rev 35439) @@ -12,9 +12,15 @@ #define va_copy __va_copy #endif +#include <Catalog.h> +#include <Locale.h> #include <Message.h> +#undef TR_CONTEXT +#define TR_CONTEXT "Utilities" + + BString trim_string(const char* string, size_t len) { @@ -231,9 +237,9 @@ url = NULL; fPackageName = package; - fCopyrights.SetTo(packageDescription, "Copyright", COPYRIGHT_STRING); - fLicenses.SetTo(packageDescription, "License"); - fSources.SetTo(packageDescription, "SourceURL"); + fCopyrights.SetTo(packageDescription, TR("Copyright"), COPYRIGHT_STRING); + fLicenses.SetTo(packageDescription, TR("License")); + fSources.SetTo(packageDescription, TR("SourceURL")); fURL = url; }