Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

is this considered good coding

Name: Anonymous 2012-01-01 13:14

the whole file is like this it is a  header file btw

char strSaveLoadReadyLoad[] = "@a004@s016@i@cffd8af Loading the above save data.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadLoading[] = "@a004@s016@i@cffd8afもう一度、このセーブデータを選択すると、すぐに Load されます。";
#else                // 英語
char strSaveLoadLoading[] = "@a004@s016@i@cffd8af If you select it once more, the data will be loaded.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadNoneTitle[] = "@s024@cffdf3f- タイトル無し -";
#else                // 英語
char strSaveLoadNoneTitle[] = "@s024@cffdf3f- No Title.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpInfoChange[] = "ファイル情報の表記を変更します。簡易タイトル、日時が交互に表示されます。";
#else                // 英語
char strSaveLoadHelpInfoChange[] = "Fight information display refreshed. Title and    date will be displayed.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpCall[] = "利用法についての詳細説明を見る事が出来ます。";
#else                // 英語
char strSaveLoadHelpCall[] = "You can view instructions on how to use this.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpCancel[] = "Load ファイルを選択している状態でも Cancel を選ぶと Load されずにゲームに戻ります。"
                        "@nSave 時は OK でも Cancel でも同じ効果です。";
#else                // 英語
char strSaveLoadHelpCancel[] = "Click cancel while selecting a file to load to    return to your current game.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpOk[] = "Load 時にファイルを選択して OK を選ぶと、データが Load されゲームが続きから始まります。"
                        "@nSave 時は、OK でも Cancel でも同じ効果です。";
#else                // 英語
char strSaveLoadHelpOk[] = "Click OK while selecting a file to load, and the  saved game will be loaded. ";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpSaveTitle[] = "ゲーム中にしか使えません。";
#else                // 英語
char strSaveLoadHelpSaveTitle[] = "Only available during game play.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpSaveMode[] = "Save モードに切り替えます。";
#else                // 英語
char strSaveLoadHelpSaveMode[] = "Switch save mode.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpLoadMode[] = "Load モードに切り替えます。";
#else                // 英語
char strSaveLoadHelpLoadMode[] = "Switch load mode";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpLoad[] = "@s016 Load するファイルを選択しました。Load する時は OK を押すか"
                        "@n@c9fefff同じファイル@cffffffを、@n@c9fefffもう一度選択@cffffffして下さい。@n"
                        " Load しない場合は、Cancel を選択するか ESC で抜けるか、右クリックして下さい。";
#else                // 英語
char strSaveLoadHelpLoad[] = "File selected. Click okay to load, or cancel to   cancel load operation.";
#endif

Name: Anonymous 2012-01-01 13:51

The correct way to do this would be to read from a map/hashtable, stored statically or in a file

something along the lines of:


--------
anus.h
--------

#define STR_IDX_ANUS 0
#define STR_IDX_FAGSTORM 1
#define STR_IDX_XARN 2
#define STR_IDX_HAX 3

char english_str_tbl[] =
{
   "Anus"
   "Fagstorm"
   "Xarn"
   "Hax"
}

char moonspeak_str_tbl[] =
{
   "モードに切り替えます"
   "選択しました"
   ...
}

#ifdef _ENGLISH
    #define _STRING_TABLE english_str_tbl
#else
    #define _STRING_TABLE moonspeak_str_tbl
#endif

--------
anus.c
--------

#include <anus.h>

void show_msg(int idx)
{
    puts(_STRING_TABLE[idx]);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List