Bunch of localization fixes pointed out by Diver. Thanks!

Notes:
- FileTypes: The "Same as" button label separated to two entities in dependency of 
             context: "Same Type as ..." and "Same Application as ...";
- Tracker:   The sentences like "If you do %action [...]. To do %action [...]"
             now use separately translated verbs for so called
             "ifYouDoAction" and "toDoAction";
- NetworkStatus: NetworkStatusView _ShowConfiguration is fixed back after previous
			 attempt to localize it in r37337: useless code bloating purged out,
             broken quasi-header "ifaceName information:" pulled back from Hell;
- StyledEdit: Menu item "Can't undo" had different casing in some situation. Looks
             like HTA cannot detect such situation, so right lines "Can't undo"
             were masked by wrong one "Can't Undo" and this line stay untranslated
             for most time.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40688 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski
2011-02-25 22:18:31 +00:00
parent c97121d35b
commit 2ee8f3f65f
11 changed files with 66 additions and 70 deletions
+4 -4
View File
@@ -1602,10 +1602,10 @@ TMailWindow::MessageReceived(BMessage *msg)
if (showAlert) { if (showAlert) {
// just some patience before Tracker pops up the folder // just some patience before Tracker pops up the folder
snooze(250000); snooze(250000);
BAlert* alert = new BAlert("helpful message", BAlert* alert = new BAlert(B_TRANSLATE("helpful message"),
"Put your favorite e-mail queries and query " B_TRANSLATE("Put your favorite e-mail queries and query "
"templates in this folder.", "templates in this folder."), B_TRANSLATE("OK"), NULL, NULL,
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_IDEA_ALERT); B_WIDTH_AS_USUAL, B_IDEA_ALERT);
alert->Go(NULL); alert->Go(NULL);
} }
+4 -1
View File
@@ -26,6 +26,7 @@
#include <string.h> #include <string.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h>
#include <Debug.h> #include <Debug.h>
#include <MediaDefs.h> #include <MediaDefs.h>
#include <Mime.h> #include <Mime.h>
@@ -50,6 +51,8 @@ const rgb_color kBlue = { 0, 0, 220, 255 };
const rgb_color kGreen = { 171, 221, 161, 255 }; const rgb_color kGreen = { 171, 221, 161, 255 };
const rgb_color kBlack = { 0, 0, 0, 255 }; const rgb_color kBlack = { 0, 0, 0, 255 };
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "MediaPlayer-InfoWin"
// should later draw an icon // should later draw an icon
class InfoView : public BView { class InfoView : public BView {
@@ -159,7 +162,7 @@ InfoView::SetGenericIcon()
InfoWin::InfoWin(BPoint leftTop, Controller* controller) InfoWin::InfoWin(BPoint leftTop, Controller* controller)
: :
BWindow(BRect(leftTop.x, leftTop.y, leftTop.x + MIN_WIDTH - 1, BWindow(BRect(leftTop.x, leftTop.y, leftTop.x + MIN_WIDTH - 1,
leftTop.y + 300), NAME, B_TITLED_WINDOW, leftTop.y + 300), B_TRANSLATE(NAME), B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE), B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE),
fController(controller), fController(controller),
fControllerObserver(new ControllerObserver(this, fControllerObserver(new ControllerObserver(this,
+5 -3
View File
@@ -166,13 +166,15 @@ static const char* kRatingAttrName = "Media:Rating";
static const char* kDisabledSeekMessage = B_TRANSLATE("Drop files to play"); static const char* kDisabledSeekMessage = B_TRANSLATE("Drop files to play");
static const char* kApplicationName = B_TRANSLATE(NAME);
//#define printf(a...) //#define printf(a...)
MainWin::MainWin(bool isFirstWindow, BMessage* message) MainWin::MainWin(bool isFirstWindow, BMessage* message)
: :
BWindow(BRect(100, 100, 400, 300), NAME, B_TITLED_WINDOW, BWindow(BRect(100, 100, 400, 300), kApplicationName, B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */), B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */),
fCreationTime(system_time()), fCreationTime(system_time()),
fInfoWin(NULL), fInfoWin(NULL),
@@ -1346,7 +1348,7 @@ MainWin::_PlaylistItemOpened(const PlaylistItemRef& item, status_t result)
fHasFile = false; fHasFile = false;
fHasVideo = false; fHasVideo = false;
fHasAudio = false; fHasAudio = false;
SetTitle(NAME); SetTitle(kApplicationName);
} else { } else {
fHasFile = true; fHasFile = true;
fHasVideo = fController->VideoTrackCount() != 0; fHasVideo = fController->VideoTrackCount() != 0;
@@ -1418,7 +1420,7 @@ MainWin::_SetupWindow()
void void
MainWin::_CreateMenu() MainWin::_CreateMenu()
{ {
fFileMenu = new BMenu(NAME); fFileMenu = new BMenu(kApplicationName);
fPlaylistMenu = new BMenu(B_TRANSLATE("Playlist"B_UTF8_ELLIPSIS)); fPlaylistMenu = new BMenu(B_TRANSLATE("Playlist"B_UTF8_ELLIPSIS));
fAudioMenu = new BMenu(B_TRANSLATE("Audio")); fAudioMenu = new BMenu(B_TRANSLATE("Audio"));
fVideoMenu = new BMenu(B_TRANSLATE("Video")); fVideoMenu = new BMenu(B_TRANSLATE("Video"));
+11 -33
View File
@@ -53,11 +53,11 @@
static const char *kStatusDescriptions[] = { static const char *kStatusDescriptions[] = {
B_TRANSLATE_MARK("Unknown"), B_TRANSLATE("Unknown"),
B_TRANSLATE_MARK("No link"), B_TRANSLATE("No link"),
B_TRANSLATE_MARK("No stateful configuration"), B_TRANSLATE("No stateful configuration"),
B_TRANSLATE_MARK("Configuring"), B_TRANSLATE("Configuring"),
B_TRANSLATE_MARK("Ready") B_TRANSLATE("Ready")
}; };
extern "C" _EXPORT BView *instantiate_deskbar_item(void); extern "C" _EXPORT BView *instantiate_deskbar_item(void);
@@ -329,9 +329,9 @@ NetworkStatusView::_ShowConfiguration(BMessage* message)
const char* label; const char* label;
int32 control; int32 control;
} kInformationEntries[] = { } kInformationEntries[] = {
{ "Address", SIOCGIFADDR }, { B_TRANSLATE("Address"), SIOCGIFADDR },
{ "Broadcast", SIOCGIFBRDADDR }, { B_TRANSLATE("Broadcast"), SIOCGIFBRDADDR },
{ "Netmask", SIOCGIFNETMASK }, { B_TRANSLATE("Netmask"), SIOCGIFNETMASK },
{ NULL } { NULL }
}; };
@@ -347,15 +347,8 @@ NetworkStatusView::_ShowConfiguration(BMessage* message)
if (!_PrepareRequest(request, name)) if (!_PrepareRequest(request, name))
return; return;
BString text = NULL; BString text(B_TRANSLATE("%ifaceName information:\n"));
if (strncmp("Address", name, strlen(name)) == 0) text.ReplaceFirst("%ifaceName", name);
text = B_TRANSLATE("Address information:\n");
if (strncmp("Broadcast", name, strlen(name)) == 0)
text = B_TRANSLATE("Broadcast information:\n");
if (strncmp("Netmask", name, strlen(name)) == 0)
text = B_TRANSLATE("Netmask information:\n");
size_t boldLength = text.Length(); size_t boldLength = text.Length();
@@ -381,22 +374,7 @@ NetworkStatusView::_ShowConfiguration(BMessage* message)
return; return;
} }
text += "\n"; text << "\n" << kInformationEntries[i].label << ": " << address;
if (strncmp("Address", kInformationEntries[i].label,
strlen(kInformationEntries[i].label)) == 0)
text += B_TRANSLATE("Address");
if (strncmp("Broadcast", kInformationEntries[i].label,
strlen(kInformationEntries[i].label)) == 0)
text += B_TRANSLATE("Broadcast");
if (strncmp("Netmask", kInformationEntries[i].label,
strlen(kInformationEntries[i].label)) == 0)
text += B_TRANSLATE("Netmask");
text += ": ";
text += address;
} }
BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK")); BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK"));
+1 -1
View File
@@ -1648,7 +1648,7 @@ StyledEditWindow::_UpdateCleanUndoRedoSaveRevert()
fRedoCleans = false; fRedoCleans = false;
fRevertItem->SetEnabled(fSaveMessage != NULL); fRevertItem->SetEnabled(fSaveMessage != NULL);
fSaveItem->SetEnabled(true); fSaveItem->SetEnabled(true);
fUndoItem->SetLabel(B_TRANSLATE("Can't Undo")); fUndoItem->SetLabel(B_TRANSLATE("Can't undo"));
fUndoItem->SetEnabled(false); fUndoItem->SetEnabled(false);
fCanUndo = false; fCanUndo = false;
fCanRedo = false; fCanRedo = false;
+4 -4
View File
@@ -85,7 +85,7 @@ enum
MainWin::MainWin(BRect frame_rect) MainWin::MainWin(BRect frame_rect)
: BWindow(frame_rect, NAME, B_TITLED_WINDOW, : BWindow(frame_rect, B_TRANSLATE(NAME), B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */) B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */)
, fController(new Controller) , fController(new Controller)
, fIsFullscreen(false) , fIsFullscreen(false)
@@ -162,7 +162,7 @@ MainWin::~MainWin()
void void
MainWin::CreateMenu() MainWin::CreateMenu()
{ {
fFileMenu = new BMenu(NAME); fFileMenu = new BMenu(B_TRANSLATE(NAME));
fChannelMenu = new BMenu(B_TRANSLATE("Channel")); fChannelMenu = new BMenu(B_TRANSLATE("Channel"));
fInterfaceMenu = new BMenu(B_TRANSLATE("Interface")); fInterfaceMenu = new BMenu(B_TRANSLATE("Interface"));
fSettingsMenu = new BMenu(B_TRANSLATE("Settings")); fSettingsMenu = new BMenu(B_TRANSLATE("Settings"));
@@ -704,8 +704,8 @@ void
MainWin::UpdateWindowTitle() MainWin::UpdateWindowTitle()
{ {
char buf[100]; char buf[100];
sprintf(buf, "%s - %d x %d, %.3f:%.3f => %.0f x %.0f", NAME, fSourceWidth, sprintf(buf, "%s - %d x %d, %.3f:%.3f => %.0f x %.0f", B_TRANSLATE(NAME),
fSourceHeight, fWidthScale, fHeightScale, fSourceWidth, fSourceHeight, fWidthScale, fHeightScale,
fVideoView->Bounds().Width() + 1, fVideoView->Bounds().Height() + 1); fVideoView->Bounds().Width() + 1, fVideoView->Bounds().Height() + 1);
SetTitle(buf); SetTitle(buf);
} }
+20 -17
View File
@@ -612,8 +612,8 @@ enum {
bool bool
ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action, ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction,
bool dontAsk, int32 *confirmedAlready) const char *toDoAction, bool dontAsk, int32 *confirmedAlready)
{ {
// Don't let the user casually move/change important files/folders // Don't let the user casually move/change important files/folders
// //
@@ -633,15 +633,15 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
if (DirectoryMatchesOrContains(entry, B_BEOS_DIRECTORY)) { if (DirectoryMatchesOrContains(entry, B_BEOS_DIRECTORY)) {
warning.SetTo( warning.SetTo(
B_TRANSLATE("If you %action the system folder or its contents, you " B_TRANSLATE("If you %ifYouDoAction the system folder or its "
"won't be able to boot " OS_NAME "! Are you sure you want to do " "contents, you won't be able to boot " OS_NAME "! Are you sure you "
"this? To %action the system folder or its contents anyway, hold down " "want to do this? To %toDoAction the system folder or its contents "
"the Shift key and click \"Do it\".")); "anyway, hold down the Shift key and click \"Do it\"."));
} else if (DirectoryMatches(entry, B_USER_DIRECTORY)) { } else if (DirectoryMatches(entry, B_USER_DIRECTORY)) {
warning .SetTo( warning .SetTo(
B_TRANSLATE("If you %action the home folder, " OS_NAME " may not " B_TRANSLATE("If you %ifYouDoAction the home folder, " OS_NAME
"behave properly! Are you sure you want to do this? " " may not behave properly! Are you sure you want to do this? "
"To %action the home anyway, click \"Do it\".")); "To %toDoAction the home anyway, click \"Do it\"."));
requireOverride = false; requireOverride = false;
} else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY) } else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY)
|| DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) { || DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) {
@@ -651,22 +651,22 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
|| DirectoryMatchesOrContains(entry, "beos_mime", || DirectoryMatchesOrContains(entry, "beos_mime",
B_COMMON_SETTINGS_DIRECTORY)) { B_COMMON_SETTINGS_DIRECTORY)) {
warning.SetTo( warning.SetTo(
B_TRANSLATE("If you %action the mime settings, " OS_NAME B_TRANSLATE("If you %ifYouDoAction the mime settings, " OS_NAME
" may not behave properly! Are you sure you want to do this? " " may not behave properly! Are you sure you want to do this? "
"To %action the mime settings anyway, click \"Do it\".")); "To %toDoAction the mime settings anyway, click \"Do it\"."));
requireOverride = false; requireOverride = false;
} else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) { } else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) {
warning.SetTo( warning.SetTo(
B_TRANSLATE("If you %action the config folder, " OS_NAME B_TRANSLATE("If you %ifYouDoAction the config folder, " OS_NAME
" may not behave properly! Are you sure you want to do this? " " may not behave properly! Are you sure you want to do this? "
"To %action the config folder anyway, click \"Do it\".")); "To %toDoAction the config folder anyway, click \"Do it\"."));
requireOverride = false; requireOverride = false;
} else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY) } else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY)
|| DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) { || DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) {
warning.SetTo( warning.SetTo(
B_TRANSLATE("If you %action the settings folder, " OS_NAME B_TRANSLATE("If you %ifYouDoAction the settings folder, " OS_NAME
" may not behave properly! Are you sure you want to do this? " " may not behave properly! Are you sure you want to do this? "
"To %action the settings folder anyway, click \"Do it\".")); "To %toDoAction the settings folder anyway, click \"Do it\"."));
requireOverride = false; requireOverride = false;
} }
} }
@@ -682,7 +682,8 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
// we already warned about moving home this time around // we already warned about moving home this time around
return true; return true;
warning.ReplaceAll("%action", action); warning.ReplaceFirst("%ifYouDoAction", ifYouDoAction);
warning.ReplaceFirst("%toDoAction", toDoAction);
if ((new OverrideAlert("", warning.String(), B_TRANSLATE("Do it"), if ((new OverrideAlert("", warning.String(), B_TRANSLATE("Do it"),
(requireOverride ? B_SHIFT_KEY : 0), B_TRANSLATE("Cancel"), 0, NULL, (requireOverride ? B_SHIFT_KEY : 0), B_TRANSLATE("Cancel"), 0, NULL,
@@ -742,7 +743,9 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
return B_ERROR; return B_ERROR;
} }
if (moveMode == kMoveSelectionTo if (moveMode == kMoveSelectionTo
&& !ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("move"), && !ConfirmChangeIfWellKnownDirectory(&entry,
B_TRANSLATE_COMMENT("move", "As in 'If you move ...'"),
B_TRANSLATE_COMMENT("move", "As in 'To move ...'"),
false, &askOnceOnly)) { false, &askOnceOnly)) {
return B_ERROR; return B_ERROR;
} }
+5 -1
View File
@@ -241,7 +241,11 @@ status_t FSFindTrackerSettingsDir(BPath *, bool autoCreate = true);
bool FSIsDeskDir(const BEntry *); bool FSIsDeskDir(const BEntry *);
bool ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action, // two separate ifYouDoAction and toDoAction versions are needed for localization
// purposes. The first one is used in "If you do action ..." sentence,
// the second one in the "To do action" sentence.
bool ConfirmChangeIfWellKnownDirectory(const BEntry *entry,
const char *ifYouDoAction, const char *toDoAction,
bool dontAsk = false, int32 *confirmedAlready = NULL); bool dontAsk = false, int32 *confirmedAlready = NULL);
bool CheckDevicesEqual(const entry_ref *entry, const Model *targetModel); bool CheckDevicesEqual(const entry_ref *entry, const Model *targetModel);
+4 -2
View File
@@ -432,7 +432,8 @@ BInfoWindow::MessageReceived(BMessage *message)
{ {
BEntry entry(fModel->EntryRef()); BEntry entry(fModel->EntryRef());
if (ConfirmChangeIfWellKnownDirectory(&entry, if (ConfirmChangeIfWellKnownDirectory(&entry,
B_TRANSLATE("rename"))) B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"),
B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'")))
fAttributeView->BeginEditingTitle(); fAttributeView->BeginEditingTitle();
break; break;
} }
@@ -1222,7 +1223,8 @@ AttributeView::MouseDown(BPoint point)
// You can't change the name of the trash // You can't change the name of the trash
if (!fModel->IsTrash() if (!fModel->IsTrash()
&& ConfirmChangeIfWellKnownDirectory(&entry, && ConfirmChangeIfWellKnownDirectory(&entry,
B_TRANSLATE("rename"), true) B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"),
B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"), true)
&& fTitleEditView == 0) && fTitleEditView == 0)
BeginEditingTitle(); BeginEditingTitle();
} else if (fTitleEditView) { } else if (fTitleEditView) {
+3 -1
View File
@@ -331,7 +331,9 @@ BTextWidget::StartEdit(BRect bounds, BPoseView *view, BPose *pose)
BEntry entry(pose->TargetModel()->EntryRef()); BEntry entry(pose->TargetModel()->EntryRef());
if (entry.InitCheck() == B_OK if (entry.InitCheck() == B_OK
&& !ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename"))) && !ConfirmChangeIfWellKnownDirectory(&entry,
B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"),
B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'")))
return; return;
// get bounds with full text length // get bounds with full text length
+5 -3
View File
@@ -76,7 +76,8 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
B_TRANSLATE("Select" B_UTF8_ELLIPSIS), new BMessage(kMsgSelectType)); B_TRANSLATE("Select" B_UTF8_ELLIPSIS), new BMessage(kMsgSelectType));
fSameTypeAsButton = new BButton("same type as", fSameTypeAsButton = new BButton("same type as",
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS), new BMessage(kMsgSameTypeAs)); B_TRANSLATE_COMMENT("Same as" B_UTF8_ELLIPSIS,
"The same TYPE as" B_UTF8_ELLIPSIS), new BMessage(kMsgSameTypeAs));
fileTypeBox->AddChild(BGridLayoutBuilder(padding, padding) fileTypeBox->AddChild(BGridLayoutBuilder(padding, padding)
.Add(fTypeControl, 0, 0, 2, 1) .Add(fTypeControl, 0, 0, 2, 1)
@@ -113,8 +114,9 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
new BMessage(kMsgSelectPreferredApp)); new BMessage(kMsgSelectPreferredApp));
fSameAppAsButton = new BButton("same app as", fSameAppAsButton = new BButton("same app as",
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS), B_TRANSLATE_COMMENT("Same as" B_UTF8_ELLIPSIS,
new BMessage(kMsgSamePreferredAppAs)); "The same APPLICATION as" B_UTF8_ELLIPSIS),
new BMessage(kMsgSamePreferredAppAs));
preferredBox->AddChild(BGridLayoutBuilder(padding, padding) preferredBox->AddChild(BGridLayoutBuilder(padding, padding)
.Add(fPreferredField, 0, 0, 2, 1) .Add(fPreferredField, 0, 0, 2, 1)