| 1026 | } |
| 1027 | |
| 1028 | std::string Host::TranslatePluralToString(const char* context, const char* msg, const char* disambiguation, int count) |
| 1029 | { |
| 1030 | TinyString count_str = TinyString::from_format("{}", count); |
| 1031 | |
| 1032 | std::string ret(msg); |
| 1033 | for (;;) |
| 1034 | { |
| 1035 | std::string::size_type pos = ret.find("%n"); |
| 1036 | if (pos == std::string::npos) |
| 1037 | break; |
| 1038 | |
| 1039 | ret.replace(pos, pos + 2, count_str.view()); |
| 1040 | } |
| 1041 | |
| 1042 | return ret; |
| 1043 | } |
| 1044 | |
| 1045 | ////////////////////////////////////////////////////////////////////////// |
| 1046 | // Platform specific code |