%T placeholder (localized Terminal name) for title mask

* %T placeholder added into the set, available for customizing main
  Terminal window title. It should be typically replaced by the
  application name localized for the currect system locale.
* Use B_TRANSLATE instead of B_TRANSLATE_SYSTEM_NAME for the first
  menu entry in the main TermWindow menu. The meaning of "Terminal"
  term in this menu is the "Terminal session" but not the "Terminal
  Application" so using separate catkeys entry for this menu item
  avoids this inconsistency in Terminal UI localization;
* Fixes #7586
This commit is contained in:
Siarzhuk Zharski 2013-02-12 20:14:30 +01:00
parent 8940ad259a
commit a5b3caa295
4 changed files with 10 additions and 2 deletions

View File

@ -62,7 +62,7 @@ static const pref_defaults kTermDefaults[] = {
{ PREF_IM_AWARE, "0"},
{ PREF_TAB_TITLE, "%1d: %p" },
{ PREF_WINDOW_TITLE, "Terminal %i: %t" },
{ PREF_WINDOW_TITLE, "%T %i: %t" },
{ PREF_BLINK_CURSOR, PREF_TRUE },
{ PREF_WARN_ON_EXIT, PREF_TRUE },

View File

@ -25,6 +25,7 @@ const char* const kTooTipSetWindowTitlePlaceholders = B_TRANSLATE(
"\t%d\t-\tThe current working directory of the active process in the\n"
"\t\t\tcurrent tab. Optionally the maximum number of path components\n"
"\t\t\tcan be specified. E.g. '%2d' for at most two components.\n"
"\t%T\t-\tThe Terminal application name for the current locale.\n"
"\t%i\t-\tThe index of the window.\n"
"\t%p\t-\tThe name of the active process in the current tab.\n"
"\t%t\t-\tThe title of the current tab.\n"

View File

@ -465,7 +465,7 @@ TermWindow::_SetupMenu()
BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
// Terminal
.AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal"))
.AddMenu(B_TRANSLATE("Terminal"))
.AddItem(B_TRANSLATE("Switch Terminals"), MENU_SWITCH_TERM, B_TAB)
.GetItem(fSwitchTerminalsMenuItem)
.AddItem(B_TRANSLATE("New Terminal"), MENU_NEW_TERM, 'N')

View File

@ -4,6 +4,8 @@
*/
#include <Catalog.h>
#include "TitlePlaceholderMapper.h"
@ -80,6 +82,11 @@ WindowTitlePlaceholderMapper::MapPlaceholder(char placeholder, int64 number,
bool numberGiven, BString& _string)
{
switch (placeholder) {
case 'T':
// The Terminal application name for the current locale
_string = B_TRANSLATE_SYSTEM_NAME("Terminal");
return true;
case 'i':
// window index
_string.Truncate(0);