Created
September 20, 2020 21:00
-
-
Save kabachuha/10b3ec48a4ef7b99b44c31e6f657b81d to your computer and use it in GitHub Desktop.
extract the gettext metadata header from the boost read .mo file bypassing empty string checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Should be used when the locale is avaible | |
template<typename MsgFormat> | |
std::string get_gettext_meta(const char* domain, std::locale& loc) | |
{ | |
boost::locale::message_format<char> const* facet = 0; | |
facet = &std::use_facet<MsgFormat>(loc); | |
const char* kek = facet->get(facet->domain(domain), NULL, ""); | |
std::string cheburek; | |
if(kek != NULL) { | |
cheburek = std::string(kek); | |
} | |
return cheburek; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment