您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vgettext函数代码示例

51自学网 2021-06-03 09:39:25
  C++
这篇教程C++ vgettext函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vgettext函数的典型用法代码示例。如果您正苦于以下问题:C++ vgettext函数的具体用法?C++ vgettext怎么用?C++ vgettext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vgettext函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: assert

void tgui_definition::load_widget_definitions(		const std::string& definition_type,		const std::vector<tcontrol_definition_ptr>& definitions){	for(const auto & def : definitions)	{		// We assume all definitions are unique if not we would leak memory.		assert(control_definition[definition_type].find(def->id)			   == control_definition[definition_type].end());		control_definition[definition_type]				.insert(std::make_pair(def->id, def));	}	utils::string_map symbols;	symbols["definition"] = definition_type;	symbols["id"] = "default";	t_string msg(vgettext("Widget definition '$definition' "						  "doesn't contain the definition for '$id'.",						  symbols));	VALIDATE(control_definition[definition_type].find("default")			 != control_definition[definition_type].end(),			 msg);}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:26,


示例2: get_addon_pbl_info

bool addons_client::delete_remote_addon(const std::string& id, std::string& response_message){	response_message.clear();	config cfg;	get_addon_pbl_info(id, cfg);	utils::string_map i18n_symbols;	i18n_symbols["addon_title"] = cfg["title"];	if(i18n_symbols["addon_title"].empty()) {		i18n_symbols["addon_title"] = make_addon_title(id);	}	config request_buf, response_buf;	config& request_body = request_buf.add_child("delete");	request_body["name"] = id;	request_body["passphrase"] = cfg["passphrase"];	LOG_ADDONS << "requesting server to delete " << id << '/n';	this->send_request(request_buf, response_buf);	this->wait_for_transfer_done(vgettext("Removing add-on <i>$addon_title</i> from the server...", i18n_symbols	));	if(const config& message_cfg = response_buf.child("message")) {		response_message = message_cfg["message"].str();		LOG_ADDONS << "server response: " << response_message << '/n';	}	return !this->update_last_error(response_buf);}
开发者ID:ehsan,项目名称:wesnoth,代码行数:32,


示例3: vgettext

void texile::discard(twindow& window){	tlistbox& list = find_widget<tlistbox>(&window, "type_list", false);	hero& h = heros_[selected_number_];	int coin_income = 0, score_income = 0;		const tgroup::tmember& m = group_.exile(h);	utils::string_map symbols;	std::string message;	symbols["name"] = tintegrate::generate_format(h.name(), "red");	symbols["coin"] = tintegrate::generate_format(coin_income, "green");	symbols["score"] = tintegrate::generate_format(score_income, "green");	message = vgettext("wesnoth-lib", "May get $coin coin and $score score, do you want to discard $name?", symbols);	int res = gui2::show_message(disp_.video(), "", message, gui2::tmessage::yes_no_buttons);	if (res == gui2::twindow::CANCEL) {		return;	}	std::vector<std::pair<int, int> > m2;	m2.push_back(std::make_pair(m.base->number_, m.level));	http::membership member = http::exile(disp_, heros_, http::exile_tag_erase, m2, coin_income, score_income);	if (member.uid < 0) {		return;	}	group_.from_local_membership(disp_, heros_, member, false);	fill_exile_table(window, list.get_selected_row());	dirty_ = true;}
开发者ID:hyrio,项目名称:War-Of-Kingdom,代码行数:31,


示例4: disp_

addons_client::addons_client(display& disp, const std::string& address)	: disp_(disp)	, addr_(address)	, host_()	, port_()	, conn_(NULL)	, stat_(NULL)	, last_error_(){	const std::vector<std::string>& address_components =		utils::split(addr_, ':');	if(address_components.empty()) {		throw invalid_server_address();	}	// FIXME: this parsing will break IPv6 numeric addresses! */	host_ = address_components[0];	port_ = address_components.size() == 2 ?		address_components[1] : str_cast(default_campaignd_port);	LOG_ADDONS << "connecting to server " << host_ << " on port " << port_ << '/n';	utils::string_map i18n_symbols;	i18n_symbols["server_address"] = addr_;	conn_ = new network_asio::connection(host_, port_);	this->wait_for_transfer_done(		vgettext("Connecting to $server_address|...", i18n_symbols));}
开发者ID:ehsan,项目名称:wesnoth,代码行数:31,


示例5: missing_widget

t_string missing_widget(const std::string& id){	utils::string_map symbols;	symbols["id"] = id;	return t_string(			vgettext("Mandatory widget '$id' hasn't been defined.", symbols));}
开发者ID:Martin9295,项目名称:wesnoth,代码行数:8,


示例6: turn_changed

void turn_changed(const std::string & player_name){	std::string id = "turn_changed";	if (notif_pref(id)) {		utils::string_map player;		player["name"] = player_name;		desktop::notifications::send(_("Turn changed"), vgettext("$name has taken control", player), desktop::notifications::TURN_CHANGED);	}}
开发者ID:Wedge009,项目名称:wesnoth,代码行数:9,


示例7: build

/*WIKI * @page = GUIWidgetInstanceWML * @order = 1 * * THIS PAGE IS AUTOMATICALLY GENERATED, DO NOT MODIFY DIRECTLY !!! * * = Widget instance = * * Inside a grid (which is inside all container widgets) a widget is * instantiated. With this instantiation some more variables of a widget can * be tuned. This page will describe what can be tuned. * */twindow* build(CVideo& video, const std::string& type){    std::vector<twindow_builder::tresolution>::const_iterator    definition = get_window_builder(type);    // We set the values from the definition since we can only determine the    // best size (if needed) after all widgets have been placed.    twindow* window = new twindow(video                                  , definition->x                                  , definition->y                                  , definition->width                                  , definition->height                                  , definition->automatic_placement                                  , definition->horizontal_placement                                  , definition->vertical_placement                                  , definition->maximum_width                                  , definition->maximum_height                                  , definition->definition);    assert(window);    window->set_id(type);    foreach(const twindow_builder::tresolution::tlinked_group& lg,            definition->linked_groups) {        if(window->has_linked_size_group(lg.id)) {            utils::string_map symbols;            symbols["id"] = lg.id;            t_string msg = vgettext(                               "Linked '$id' group has multiple definitions."                               , symbols);            VALIDATE(false, msg);        }        window->init_linked_size_group(            lg.id, lg.fixed_width, lg.fixed_height);    }    window->set_click_dismiss(definition->click_dismiss);    boost::intrusive_ptr<const twindow_definition::tresolution> conf =        boost::dynamic_pointer_cast<        const twindow_definition::tresolution>(window->config());    assert(conf);    if(conf->grid) {        window->init_grid(conf->grid);        window->finalize(definition->grid);    } else {        window->init_grid(definition->grid);    }    window->add_to_keyboard_chain(window);    return window;}
开发者ID:mikolson,项目名称:WesnothAddonServer,代码行数:69,


示例8: cursor_setter

bool addons_client::install_addon(config& archive_cfg, const addon_info& info){	const cursor::setter cursor_setter(cursor::WAIT);	utils::string_map i18n_symbols;	i18n_symbols["addon_title"] = info.title;	if(!check_names_legal(archive_cfg)) {		gui2::show_error_message(disp_.video(),			vgettext("The add-on <i>$addon_title</i> has an invalid file or directory "				"name and cannot be installed.", i18n_symbols));		return false;	}	// Add local version information before unpacking	config* maindir = &archive_cfg.find_child("dir", "name", info.id);	if(!*maindir) {		LOG_ADDONS << "downloaded add-on '" << info.id << "' is missing its directory in the archive; creating it/n";		maindir = &archive_cfg.add_child("dir");		(*maindir)["name"] = info.id;	}	LOG_ADDONS << "generating version info for add-on '" << info.id << "'/n";	std::ostringstream info_contents;	config wml;	info_contents <<		"#/n"		"# File automatically generated by Wesnoth to keep track/n"		"# of version information on installed add-ons. DO NOT EDIT!/n"		"#/n";	info.write_minimal(wml.add_child("info"));	write(info_contents, wml);	config file;	file["name"] = "_info.cfg";	file["contents"] = info_contents.str();	maindir->add_child("file", file);	LOG_ADDONS << "unpacking " << info.id << '/n';	// Remove any previously installed versions	if(!remove_local_addon(info.id)) {		WRN_ADDONS << "failed to uninstall previous version of " << info.id << "; the add-on may not work properly!/n";	}	unarchive_addon(archive_cfg);	LOG_ADDONS << "unpacking finished/n";	return true;}
开发者ID:ehsan,项目名称:wesnoth,代码行数:55,


示例9: _

void tgame_load::evaluate_summary_string(std::stringstream& str		, const config& cfg_summary){	const std::string& campaign_type = cfg_summary["campaign_type"];	if (cfg_summary["corrupt"].to_bool()) {		str << "/n" << _("#(Invalid)");	} else if (!campaign_type.empty()) {		str << "/n";		if(campaign_type == "scenario") {			const std::string campaign_id = cfg_summary["campaign"];			const config *campaign = NULL;			if (!campaign_id.empty()) {				if (const config &c = cache_config_.find_child(						"campaign", "id", campaign_id))					campaign = &c;			}			utils::string_map symbols;			if (campaign != NULL) {				symbols["campaign_name"] = (*campaign)["name"];			} else {				// Fallback to nontranslatable campaign id.				symbols["campaign_name"] = "(" + campaign_id + ")";			}			str << vgettext("Campaign: $campaign_name", symbols);			// Display internal id for debug purposes if we didn't above			if (game_config::debug && (campaign != NULL)) {				str << '/n' << "(" << campaign_id << ")";			}		} else if(campaign_type == "multiplayer") {			str << _("Multiplayer");		} else if(campaign_type == "tutorial") {			str << _("Tutorial");		} else {			str << campaign_type;		}		str << "/n";		if (cfg_summary["replay"].to_bool() && !cfg_summary["snapshot"].to_bool(true)) {			str << _("replay");		} else if (!cfg_summary["turn"].empty()) {			str << _("Turn") << " " << cfg_summary["turn"];		} else {			str << _("Scenario Start");		}		if(!cfg_summary["version"].empty()) {			str << "/n" << _("Version: ") << cfg_summary["version"];		}	}}
开发者ID:coolsee,项目名称:War-Of-Kingdom,代码行数:54,


示例10: vgettext

void tlobby_main::update_gamelist_header(){#ifndef GUI2_EXPERIMENTAL_LISTBOX	const std::string games_string = vgettext("Games: showing $num_shown out of $num_total", {		{"num_shown", std::to_string(lobby_info_.games_filtered().size())},		{"num_total", std::to_string(lobby_info_.games().size())}	});	find_widget<tlabel>(gamelistbox_, "map", false).set_label(games_string);#endif}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:11,


示例11: add_active_window_message

void tchatbox::add_whisper_sent(const std::string& receiver, const std::string& message){	if(whisper_window_active(receiver)) {		add_active_window_message(preferences::login(), message, true);	} else if(tlobby_chat_window* t = whisper_window_open(receiver, preferences::auto_open_whisper_windows())) {		switch_to_window(t);		add_active_window_message(preferences::login(), message, true);	} else {		add_active_window_whisper(vgettext("whisper to $receiver", {{"receiver", receiver}}), message, true);	}	lobby_info().get_whisper_log(receiver).add_message(preferences::login(), message);}
开发者ID:bumbadadabum,项目名称:wesnoth,代码行数:13,


示例12: level

/*** Change the log level of a log domain.** @param data string of the form: "@<[email
C++ vhost_net_flush函数代码示例
C++ vget函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。