-/* File: main-mac.c */
+/* File: main-mac.c */
/* Purpose: Simple support for MACINTOSH Angband */
/*
* Cleaning up a couple of things to make these easier to change --AR
*/
-#ifdef JP
-#define PREF_FILE_NAME "Hengband Preferences"
-#else
-#define PREF_FILE_NAME "Hengband-E Preferences"
-#endif
+#define PREF_FILE_NAME _("Hengband Preferences", "Hengband-E Preferences")
/*
* Use "malloc()" instead of "NewPtr()"
* Although there is no easy way to emulate fstat in the old interface,
* we still can do stat-like things, because Mac OS is an OS.
*/
-static int get_modification_time(cptr path, u32b *mod_time)
+static int get_modification_time(concptr path, u32b *mod_time)
{
CInfoPBRec pb;
Str255 pathname;
* A (non-Mach-O) Mac OS version of check_modification_time, for those
* compilers without good enough POSIX-compatibility libraries XXX XXX
*/
-errr check_modification_date(int fd, cptr template_file)
+errr check_modification_date(int fd, concptr template_file)
{
#pragma unused(fd)
u32b txt_stat, raw_stat;
* Set creator and filetype of a file specified by POSIX-style pathname.
* Returns 0 on success, -1 in case of errors.
*/
-void fsetfileinfo(cptr pathname, OSType fcreator, OSType ftype)
+void fsetfileinfo(concptr pathname, OSType fcreator, OSType ftype)
{
OSErr err;
FSSpec spec;
/*
* Display a warning message
*/
-static void mac_warning(cptr warning)
+static void mac_warning(concptr warning)
{
Str255 text;
int len, i;
}
/* Notify error */
-#ifdef JP
- plog("¥µ¥¦¥ó¥É¥Á¥ã¥ó¥Í¥ë¤ò½é´ü²½½ÐÍè¤Þ¤»¤ó!");
-#else
- plog("Cannot initialise sound channels!");
-#endif
+ plog(_("サウンドチャンネルを初期化出来ません!", "Cannot initialise sound channels!"));
/* Cancel request */
use_sound = arg_sound = FALSE;
if ((graf_mode_req != GRAF_MODE_NONE) && !frameP && (globe_init() != 0))
{
-#ifdef JP
- plog("¥°¥é¥Õ¥£¥Ã¥¯¤Î½é´ü²½¤Ï½ÐÍè¤Þ¤»¤ó¤Ç¤·¤¿.");
-#else
- plog("Cannot initialize graphics!");
-#endif
+ plog(_("グラフィックの初期化は出来ませんでした.", "Cannot initialize graphics!"));
/* reject request */
graf_mode_req = GRAF_MODE_NONE;
err = PBGetFCBInfo(&fcbBlock, FALSE);
if (err != noErr)
{
-#ifdef JP
- sprintf(errString, "PBGetFCBInfo ¥¨¥é¡¼ #%d.\r ½ªÎ»¤·¤Þ¤¹.", err);
-#else
- sprintf(errString, "Fatal PBGetFCBInfo Error #%d.\r Exiting.", err);
-#endif
+ sprintf(errString, _("PBGetFCBInfo エラー #%d.\r 終了します.", "Fatal PBGetFCBInfo Error #%d.\r Exiting."), err);
mac_warning(errString);
ExitToShell();
}
err = HSetVol(NULL, app_vol, app_dir);
if (err != noErr)
{
-#ifdef JP
- sprintf(errString, "HSetVol ¥¨¥é¡¼ #%d.\r ½ªÎ»¤·¤Þ¤¹.", err);
-#else
- sprintf(errString, "Fatal HSetVol Error #%d.\r Exiting.", err);
-#endif
+ sprintf(errString, _("HSetVol エラー #%d.\r 終了します.", "Fatal HSetVol Error #%d.\r Exiting."), err);
mac_warning(errString);
ExitToShell();
}
if (!ok)
{
/* This may be the first run */
-#ifdef JP
- mac_warning("½é´üÀßÄê¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£");
-#else
- mac_warning("Preferences are not found.");
-#endif
+ mac_warning(_("初期設定ファイルが見つかりません。", "Preferences are not found."));
/* Ignore the rest */
return;
{
/* Message */
#ifdef JP
- mac_warning("¸Å¤¤½é´üÀßÄê¥Õ¥¡¥¤¥ë¤ò̵»ë¤·¤Þ¤¹.");
+ mac_warning("古い初期設定ファイルを無視します.");
#else
mac_warning("Ignoring old preferences.");
#endif
#if TARGET_API_MAC_CARBON
#ifdef JP
/* Default to Osaka font (Japanese) */
- fid = FMGetFontFamilyFromName( "\pOsaka¡ÝÅùÉý" );
+ fid = FMGetFontFamilyFromName( "\pOsaka−等幅" );
#else
/* Default to Monaco font */
fid = FMGetFontFamilyFromName("\pmonaco");
#endif
#else
#ifdef JP
- /* Default to ÅùÉýÌÀÄ« font (Japanese) */
- GetFNum( "\pÅùÉýÌÀÄ«", &fid);
+ /* Default to 等幅明朝 font (Japanese) */
+ GetFNum( "\p等幅明朝", &fid);
SetFScaleDisable( true );
#else
/* Default to Monaco font */
{
int n;
- cptr s;
+ concptr s;
/* Obtain */
td = &data[i];
mbar = GetNewMBar(128);
/* Whoops! */
-#ifdef JP
- if (mbar == nil) quit("¥á¥Ë¥å¡¼¥Ð¡¼ ID 128¤ò¸«¤Ä¤±¤ë»ö¤¬¤Ç¤¤Þ¤»¤ó!");
-#else
- if (mbar == nil) quit("Cannot find menubar('MBAR') id 128!");
-#endif
+ if (mbar == nil) quit(_("メニューバー ID 128を見つける事ができません!", "Cannot find menubar('MBAR') id 128!"));
/* Insert them into the current menu list */
SetMenuBar(mbar);
/* Get the "File" menu */
#if TARGET_API_MAC_CARBON
- m = GetMenu(MENU_FILE);
+ m = GetMenuHandle(MENU_FILE);
err = Gestalt( gestaltSystemVersion, &response );
if ( (err == noErr) && (response >= 0x00000A00) )
{
case ITEM_SAVE:
{
if (!can_save){
-#ifdef JP
- plog("º£¤Ï¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
+ plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
break;
}
if (game_in_progress && character_generated)
{
if (!can_save){
-#ifdef JP
- plog("º£¤Ï¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
+ plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
break;
}
/* Hack -- Forget messages */
if (game_in_progress && character_generated)
{
if (!can_save){
-#ifdef JP
- plog("º£¤Ï¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
+ plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
return;
}
/* Hack -- Forget messages */
if (AEProcessAppleEvent(&event) != noErr)
{
#ifdef JP
- plog("Apple Event Handler¤Î¥¨¥é¡¼¤Ç¤¹.");
+ plog("Apple Event Handlerのエラーです.");
#else
plog("Error in Apple Event Handler!");
#endif
/* Mega-Hack -- Warning */
#ifdef JP
- mac_warning("¥á¥â¥ê¡¼¤¬Â¤ê¤Þ¤»¤ó!\rº£¤¹¤°½ªÎ»¤·¤Æ²¼¤µ¤¤!");
+ mac_warning("メモリーが足りません!\r今すぐ終了して下さい!");
#else
mac_warning("Running out of Memory!\rAbort this process now!");
#endif
/*
* Hook to tell the user something important
*/
-static void hook_plog(cptr str)
+static void hook_plog(concptr str)
{
/* Warning message */
mac_warning(str);
/*
* Hook to tell the user something, and then quit
*/
-static void hook_quit(cptr str)
+static void hook_quit(concptr str)
{
/* Warning if needed */
if (str) mac_warning(str);
/*
* Hook to tell the user something, and then crash
*/
-static void hook_core(cptr str)
+static void hook_core(concptr str)
{
/* XXX Use the debugger */
/* DebugStr(str); */
/* Warn, then save player */
#ifdef JP
- mac_warning("Ã×̿Ū¤Ê¥¨¥é¡¼¤Ç¤¹.\r¶¯À©Åª¤Ë¥»¡¼¥Ö¤·¤Æ½ªÎ»¤·¤Þ¤¹.");
+ mac_warning("致命的なエラーです.\r強制的にセーブして終了します.");
#else
mac_warning("Fatal error.\rI will now attempt to save and quit.");
#endif
/* Attempt to save */
#ifdef JP
- if (!save_player()) mac_warning("·Ù¹ð -- ¥»¡¼¥Ö¤Ë¼ºÇÔ¤·¤Þ¤·¤¿!");
+ if (!save_player()) mac_warning("警告 -- セーブに失敗しました!");
#else
if (!save_player()) mac_warning("Warning -- save failed!");
#endif
init_file_paths(path);
/* Build the filename */
-#ifdef JP
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news_j.txt");
-#else
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news.txt");
-#endif
+ path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
/* Attempt to open and close that file */
if (0 == fd_close(fd_open(path, O_RDONLY))) break;
/* Warning */
-#ifdef JP
- plog_fmt("'%s' ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó½ÐÍè¤Þ¤»¤ó.", path);
-#else
- plog_fmt("Unable to open the '%s' file.", path);
-#endif
+ plog_fmt(_("'%s' ファイルをオープン出来ません.", "Unable to open the '%s' file."), path);
/* Warning */
-#ifdef JP
- plog("Hengband¤Î'lib'¥Õ¥©¥ë¥À¤¬Â¸ºß¤·¤Ê¤¤¤«Àµ¤·¤¯Ìµ¤¤²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹.");
-#else
- plog("The Angband 'lib' folder is probably missing or misplaced.");
-#endif
+ plog(_("Hengbandの'lib'フォルダが存在しないか正しく無い可能性があります.", "The Angband 'lib' folder is probably missing or misplaced."));
/* Warning */
-#ifdef JP
- plog("Please 'open' any file in any sub-folder of the 'lib' folder.");
-#else
- plog("Please 'open' any file in any sub-folder of the 'lib' folder.");
-#endif
+ plog(_("Please 'open' any file in any sub-folder of the 'lib' folder.", "Please 'open' any file in any sub-folder of the 'lib' folder."));
#if TARGET_API_MAC_CARBON
/* Ask the user to choose the lib folder */
if ((err != noErr) || (versionNumber < 0x0700))
{
#ifdef JP
- quit("¤³¤Î¥×¥í¥°¥é¥à¤Ï´Á»úTalk7.x.x°Ê¹ß¤ÇÆ°ºî¤·¤Þ¤¹.");
+ quit("このプログラムは漢字Talk7.x.x以降で動作します.");
#else
quit("You must have System 7 to use this program.");
#endif
if (SysEnvirons(1, &env) != noErr)
{
#ifdef JP
- quit("SysEnvirons ¥³¡¼¥ë¤Ï¼ºÇÔ¤·¤Þ¤·¤¿¡ª");
+ quit("SysEnvirons コールは失敗しました!");
#else
quit("The SysEnvirons call failed!");
#endif
if (env.systemVersion < 0x0700)
{
#ifdef JP
- quit("¤³¤Î¥×¥í¥°¥é¥à¤Ï´Á»úTalk7.x.x°Ê¹ß¤ÇÆ°ºî¤·¤Þ¤¹.");
+ quit("このプログラムは漢字Talk7.x.x以降で動作します.");
#else
quit("You must have System 7 to use this program.");
#endif
if (!env.hasColorQD)
{
#ifdef JP
- quit("¤³¤Î¥×¥í¥°¥é¥à¤ÏColor Quickdraw¤¬Ìµ¤¤¤ÈÆ°ºî¤·¤Þ¤»¤ó.");
+ quit("このプログラムはColor Quickdrawが無いと動作しません.");
#else
quit("You must have Color Quickdraw to use this program.");
#endif
#endif
/* Prompt the user */
-#ifdef JP
- prt("'¥Õ¥¡¥¤¥ë'¥á¥Ë¥å¡¼¤è¤ê'¿·µ¬'¤Þ¤¿¤Ï'³«¤¯...'¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£", 23, 10);
-#else
- prt("[Choose 'New' or 'Open' from the 'File' menu]", 23, 15);
-#endif
+ prt(_("'ファイル'メニューより'新規'または'開く...'を選択してください。", "[Choose 'New' or 'Open' from the 'File' menu]"), 23, _(10, 15));
/* Flush the prompt */
Term_fresh();