Ticket #7347: pulse-localization-fix.patch
File pulse-localization-fix.patch, 8.4 KB (added by , 13 years ago) |
---|
-
src/apps/pulse/ConfigView.cpp
16 16 17 17 #include <Catalog.h> 18 18 #include <CheckBox.h> 19 #include <Locale.h>20 19 #include <RadioButton.h> 21 20 #include <TextControl.h> 22 21 -
src/apps/pulse/MiniPulseView.cpp
11 11 #include "MiniPulseView.h" 12 12 #include "Common.h" 13 13 #include <Catalog.h> 14 #include <Locale.h>15 14 #include <interface/Window.h> 16 15 17 16 #undef B_TRANSLATE_CONTEXT -
src/apps/pulse/PrefsWindow.cpp
16 16 17 17 #include <Catalog.h> 18 18 #include <Button.h> 19 #include <Locale.h>20 19 #include <TabView.h> 21 20 #include <TextControl.h> 22 21 -
src/apps/pulse/DeskbarPulseView.cpp
15 15 #include <Catalog.h> 16 16 #include <interface/Deskbar.h> 17 17 #include <interface/Alert.h> 18 #include <Locale.h>19 18 #include <Roster.h> 20 19 #include <stdlib.h> 21 20 #include <string.h> 22 21 #include <stdio.h> 22 #include <TextView.h> 23 23 24 24 #undef B_TRANSLATE_CONTEXT 25 25 #define B_TRANSLATE_CONTEXT "DeskbarPulseView" … … 124 124 prefswindow->Show(); 125 125 break; 126 126 case PV_ABOUT: { 127 BString msgStr = B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n" 128 "Revised by Daniel Switkin"); 129 msgStr << "\n"; 127 130 BAlert *alert = new BAlert(B_TRANSLATE("Info"), 128 B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n" 129 "Revised by Daniel Switkin"), B_TRANSLATE("OK")); 131 msgStr.String(), B_TRANSLATE("OK")); 132 BTextView* view = alert->TextView(); 133 BFont font; 134 135 view->SetStylable(true); 136 view->GetFont(&font); 137 138 font.SetSize(18); 139 font.SetFace(B_BOLD_FACE); 140 view->SetFontAndColor(0, strlen(B_TRANSLATE("Pulse")), &font); 141 alert->SetShortcut(0, B_ESCAPE); 130 142 alert->Go(NULL); 131 143 break; 132 144 } … … 179 191 sprintf(temp, B_TRANSLATE("Remove(): %s"), strerror(err)); 180 192 BAlert *alert = new BAlert(B_TRANSLATE("Info"), temp, 181 193 B_TRANSLATE("OK")); 194 alert->SetShortcut(0, B_ESCAPE); 182 195 alert->Go(NULL); 183 196 } 184 197 delete deskbar; -
src/apps/pulse/PulseWindow.cpp
17 17 #include <Alert.h> 18 18 #include <Catalog.h> 19 19 #include <Deskbar.h> 20 #include <Locale.h>21 20 #include <Screen.h> 21 #include <TextView.h> 22 22 23 23 #include <stdlib.h> 24 24 #include <string.h> … … 28 28 29 29 30 30 PulseWindow::PulseWindow(BRect rect) : 31 BWindow(rect, "Pulse", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)31 BWindow(rect, B_TRANSLATE("Pulse"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) 32 32 { 33 33 SetPulseRate(200000); 34 35 SetTitle(B_TRANSLATE("Pulse"));36 34 37 35 PulseApp *pulseapp = (PulseApp *)be_app; 38 36 BRect bounds = Bounds(); … … 103 101 break; 104 102 } 105 103 case PV_ABOUT: { 104 BString msgStr = B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve " 105 "Hjønnevåg\nRevised by Daniel Switkin"); 106 msgStr << "\n"; 106 107 BAlert *alert = new BAlert(B_TRANSLATE("Info"), 107 B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n" 108 "Revised by Daniel Switkin"), B_TRANSLATE("OK")); 108 msgStr.String(), B_TRANSLATE("OK")); 109 BTextView* view = alert->TextView(); 110 BFont font; 111 112 view->SetStylable(true); 113 114 view->GetFont(&font); 115 font.SetSize(18); 116 font.SetFace(B_BOLD_FACE); 117 view->SetFontAndColor(0, strlen(B_TRANSLATE("Pulse")), &font); 118 alert->SetShortcut(0, B_ESCAPE); 109 119 // Use the asynchronous version so we don't block the window's thread 110 120 alert->Go(NULL); 111 121 break; -
src/apps/pulse/CPUButton.cpp
16 16 #include <Alert.h> 17 17 #include <Catalog.h> 18 18 #include <Dragger.h> 19 #include <Locale.h>20 19 #include <PopUpMenu.h> 21 20 #include <TextView.h> 22 21 #include <ViewPrivate.h> 23 22 24 23 #include <syscalls.h> … … 241 240 if (!LastEnabledCPU(fCPU)) { 242 241 _kern_set_cpu_enabled(fCPU, Value()); 243 242 } else { 244 BAlert *alert = new BAlert(NULL, B_TRANSLATE("You can't disable the " 245 "last active CPU."), B_TRANSLATE("OK")); 243 BString msgStr = B_TRANSLATE("You can't disable the last active CPU."); 244 msgStr << "\n"; 245 BAlert *alert = new BAlert(B_TRANSLATE("Error"), 246 msgStr.String(), B_TRANSLATE("OK")); 247 alert->SetShortcut(0, B_ESCAPE); 246 248 alert->Go(NULL); 247 249 SetValue(!Value()); 248 250 } … … 276 278 { 277 279 switch (message->what) { 278 280 case B_ABOUT_REQUESTED: { 281 BString msgStr = B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve " 282 "Hjønnevåg\nRevised by Daniel Switkin"); 283 msgStr << "\n"; 279 284 BAlert *alert = new BAlert(B_TRANSLATE("Info"), 280 B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n" 281 "Revised by Daniel Switkin"), B_TRANSLATE("OK")); 285 msgStr.String(), B_TRANSLATE("OK")); 286 BTextView* view = alert->TextView(); 287 BFont font; 288 289 view->SetStylable(true); 290 291 view->GetFont(&font); 292 font.SetSize(18); 293 font.SetFace(B_BOLD_FACE); 294 view->SetFontAndColor(0, strlen(B_TRANSLATE("Pulse")), &font); 295 alert->SetShortcut(0, B_ESCAPE); 296 282 297 // Use the asynchronous version so we don't block the window's thread 283 298 alert->Go(NULL); 284 299 break; -
src/apps/pulse/PulseView.cpp
16 16 17 17 #include <Alert.h> 18 18 #include <Catalog.h> 19 #include <Locale.h>20 19 21 20 #include <syscalls.h> 22 21 … … 128 127 if (!LastEnabledCPU(which)) { 129 128 _kern_set_cpu_enabled(which, (int)!cpu_menu_items[which]->IsMarked()); 130 129 } else { 131 BAlert *alert = new BAlert(NULL, B_TRANSLATE("You can't disable the " 132 "last active CPU."), B_TRANSLATE("OK")); 130 BString msgStr = B_TRANSLATE("You can't disable the last active CPU."); 131 msgStr << "\n"; 132 BAlert *alert = new BAlert(B_TRANSLATE("Error"), 133 msgStr.String(), B_TRANSLATE("OK")); 134 alert->SetShortcut(0, B_ESCAPE); 133 135 alert->Go(NULL); 134 136 } 135 137 } -
src/apps/pulse/Jamfile
40 40 PrefsWindow.cpp 41 41 PulseWindow.cpp 42 42 ; 43 44 AddCatalogEntryAttribute Pulse 45 : 46 x-vnd.Haiku-Pulse:PulseWindow:Pulse 47 ; 48 -
src/apps/pulse/PulseApp.cpp
21 21 #include <Alert.h> 22 22 #include <Catalog.h> 23 23 #include <Deskbar.h> 24 #include <Locale.h>25 24 #include <Rect.h> 26 25 27 26 #include <syscalls.h> … … 234 233 delete replicant; 235 234 delete deskbar; 236 235 if (err != B_OK) { 237 BAlert *alert = new BAlert(NULL, strerror(err), B_TRANSLATE("OK")); 236 BAlert *alert = new BAlert(B_TRANSLATE("Error"), strerror(err), B_TRANSLATE("OK")); 237 alert->SetShortcut(0, B_ESCAPE); 238 238 alert->Go(NULL); 239 239 return false; 240 240 } -
src/apps/pulse/NormalPulseView.cpp
16 16 #include <Catalog.h> 17 17 #include <Bitmap.h> 18 18 #include <Dragger.h> 19 #include <Locale.h>20 19 #include <Window.h> 21 20 22 21 #include <stdlib.h> … … 203 202 char buffer[64]; 204 203 int32 cpuSpeed = get_rounded_cpu_speed(); 205 204 if (cpuSpeed > 1000 && (cpuSpeed % 10) == 0) 206 snprintf(buffer, sizeof(buffer), "%.2f GHz", cpuSpeed / 1000.0f);205 snprintf(buffer, sizeof(buffer), B_TRANSLATE("%.2f GHz"), cpuSpeed / 1000.0f); 207 206 else 208 snprintf(buffer, sizeof(buffer), "%ld MHz", cpuSpeed);207 snprintf(buffer, sizeof(buffer), B_TRANSLATE("%ld MHz"), cpuSpeed); 209 208 210 209 // We can't assume anymore that a CPU clock speed is always static. 211 210 // Let's compute the best font size for the CPU speed string each time...