25#include "../abi/string.hpp"
26#include "simple_messages.hpp"
34namespace essence::globalization {
36 using globalized_arg_t = std::conditional_t<std::convertible_to<T, std::string_view>, abi::string, T>;
39 decltype(
auto) make_globalized_arg(
const std::locale& locale, T&& arg) {
40 if constexpr (std::convertible_to<T, std::string_view>) {
41 if (std::has_facet<simple_messages>(locale)) {
42 return std::use_facet<simple_messages>(locale).get(std::forward<T>(arg));
45 return abi::string{std::string_view{std::forward<T>(arg)}};
47 return std::forward<T>(arg);