wallet/localization.h

83 lines
4.2 KiB
C
Raw Normal View History

// Localization.h
// Everything that will need translation should be in localization.cpp
// But this task is barely begun, there are no end of English language
// strings strewn at random about the program which need to be moved to
// localization.h and localization.cpp
// I intend that the download pages will be part of the git repository,
// and that when we support multiple languages, the end user will download
// the executable for his language, that we will build a complete
// executable and complete install for every language supported.
// Nearly all of these strings, all of them right now, are seven bit ascii,
// so unicode does not matter but it did a short time ago, and when we get
// around to localization, providing several versions of the localization
// file in several languages, it will matter again. Since network is utf8
// the whole program has to be utf, even if localization not an issue.
//Menu strings
struct menu_string {
const char* head;
const char*(* tail)[2];
};
extern const menu_string* menu_strings;
// Strings for the startup display, load existing wallet or create new
// wallet.
// String array for the english passphrase
// (the actual strings are in locale.cpp
constexpr auto sizeofwordlist = 2048;
extern const char* const ar_sz_bip_0039_wordlist[];
//Strings for the startup display, load existing wallet or create new wallet.
extern const char sz_NewWallet[];
extern const char sz_unit_test_log[];
extern const char sz_welcome_to_rocoin[];
extern const char sz_please_select_from_three_options[];
extern const char sz_create_a_new_wallet[];
extern const char sz_new_wallet[];
extern const char sz_recreate_wallet_from_old_secret[];
extern const char sz_existing_secret[];
extern const char sz_open_existing_wallet[];
extern const char sz_existing_wallet[];
extern const char sz_text_buffer_overflow[];
extern const char sz_unknown_error[];
//Error message strings
extern const wchar_t wsz_error[];
extern const wchar_t wsz_operation[];
extern const wchar_t wsz_program[];
inline constexpr auto sz_inconsistent_hash{ R"(Same data hashed in different ways produces inconsistent results)" };
inline constexpr auto sz_unexpected_scalar_from_string{ R"(Unexpected scalar from string)" };
inline constexpr auto sz_unexpected_point_from_scalar{ R"(Unexpected point from scalar from string)" };
inline constexpr auto sz_bitcount_incorrect{ "bitcount incorrect" };
inline constexpr auto sz_rounded_log2_incorrect{ R"(rounded log(2), ⌊log(2)⌋, incorrect)" };
inline constexpr auto sz_count_of_trailing_zero_bits_incorrect{ R"(count of trailing zero bits incorrect)" };
inline constexpr auto sz_new_wallet_new_secret{ "Creating new wallet with new master secret" };
inline constexpr auto sz_default_wallet_name{ "default.wallet" };
inline constexpr auto sz_wallet_files_title{ "wallet files (*.wallet)|*.wallet" };
inline constexpr auto sz_open_wallet_file{L"Open wallet file"};
inline constexpr auto sz_new_wallet_existing_secret{L"Creating new wallet from existing wallet master secret"};
inline constexpr auto sz_unrecognizable_wallet_file_format{ "Unrecognizable wallet file format" };
inline constexpr auto sz_unrecognized_wallet_schema{ "Unrecognized wallet schema" };
inline constexpr auto sz_mastersecret_missing{ "Mastersecret missing" };
inline constexpr auto sz_cold_wallets_not_yet_implemented{ "Code to handle cold wallets not yet implemented" };
inline constexpr auto sz_unknown_secret_key_algorithm{ R"|(Unknown secret key algorithm index in "Names" table)|" };
inline constexpr auto sz_no_corresponding_entry{ R"|(No entry corresponding to public key in "Names" table)|" };
inline constexpr auto sz_name_does_not_correspond{ R"|(Public key of name fails to correspond)|" };
inline constexpr auto sz_public_key_of{ R"|(Public key of ")|" };
inline constexpr auto sz_fails_to_correspond{ R"|(" fails to correspond to master secret.
This wallet cannot communicate as this identity.)|" };
//Command line parameters
extern const wchar_t wsz_commandLineLogo[];
extern const wchar_t wsz_usageText[];
extern const char FailureToThrowExpectedException_sz[];
// Strings for the self test are not represented here, though they probably
// should be.
bool IsValidUtf8String(const char*);