本文整理汇总了C++中Language::LanguageTag方法的典型用法代码示例。如果您正苦于以下问题:C++ Language::LanguageTag方法的具体用法?C++ Language::LanguageTag怎么用?C++ Language::LanguageTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::LanguageTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DownloadFile
void CrowdinClient::DownloadFile(const std::string& project_id, const std::wstring& file, const Language& lang,
const std::wstring& output_file,
std::function<void()> onSuccess,
error_func_t onError)
{
// NB: "export_translated_only" means the translation is not filled with the source string
// if there's no translation, i.e. what Poedit wants.
auto url = "/api/project/" + project_id + "/export-file"
"?json="
"&export_translated_only=1"
"&language=" + lang.LanguageTag() +
"&file=" + http_client::url_encode(file);
m_api->download(url, output_file, onSuccess, onError);
}
示例2: UploadFile
void CrowdinClient::UploadFile(const std::string& project_id, const std::wstring& file, const Language& lang,
const std::string& file_content,
std::function<void()> onSuccess,
error_func_t onError)
{
auto url = "/api/project/" + project_id + "/upload-translation";
multipart_form_data data;
data.add_value("json", "");
data.add_value("language", lang.LanguageTag());
data.add_value("import_duplicates", "0");
data.add_value("import_eq_suggestions", "0");
data.add_file("files[" + str::to_utf8(file) + "]", "upload.po", file_content);
m_api->post(url, data, onSuccess, onError);
}