Refactored gender-related labels in multiple languages for chat input fields, improving localization consistency and user experience across the application.
This commit is contained in:
@@ -372,7 +372,8 @@ void App::connectToServer() {
|
||||
void App::populateGenderComboBox(Wt::WComboBox *genderWidget) {
|
||||
int markIndex{-1};
|
||||
for (const auto &genderItem: genders_) {
|
||||
genderWidget->addItem(genderItem.second);
|
||||
auto label = Wt::WString::tr(genderItem.second.toUTF8());
|
||||
genderWidget->addItem(label);
|
||||
if (genderItem.first == "F") {
|
||||
markIndex = genderWidget->count();
|
||||
}
|
||||
@@ -382,7 +383,8 @@ void App::populateGenderComboBox(Wt::WComboBox *genderWidget) {
|
||||
|
||||
std::string App::getGenderShortByGender(std::string gender) {
|
||||
for (const auto &genderItem: genders_) {
|
||||
if (gender == genderItem.second) {
|
||||
auto label = Wt::WString::tr(genderItem.second.toUTF8()).toUTF8();
|
||||
if (gender == label) {
|
||||
return genderItem.first.toUTF8();
|
||||
}
|
||||
}
|
||||
|
||||
11
src/app.h
11
src/app.h
@@ -23,12 +23,13 @@ private:
|
||||
const std::string adminName {"comiciusadmin"};
|
||||
const std::string adminPassword {"p3Lv9!7?+Qq"};
|
||||
|
||||
// Key: short gender code used in the protocol, Value: translation id for display text
|
||||
std::map<Wt::WString, Wt::WString> genders_ {
|
||||
{"F", "Female"},
|
||||
{"M", "Male"},
|
||||
{"P", "Pair"},
|
||||
{"TF", "Transgender (M->F)"},
|
||||
{"TM", "Transgender (F->M)"}
|
||||
{"F", "gender_female"},
|
||||
{"M", "gender_male"},
|
||||
{"P", "gender_pair"},
|
||||
{"TF", "gender_trans_mf"},
|
||||
{"TM", "gender_trans_fm"}
|
||||
};
|
||||
std::vector<std::string> notAllowedNickPhrases_ {
|
||||
"whore",
|
||||
|
||||
Reference in New Issue
Block a user