Skip to content

Commit

Permalink
Added an option to simplify the form of woman single surnames in exte…
Browse files Browse the repository at this point in the history
…nded mode (fix #598)
  • Loading branch information
Serg-Norseman committed Sep 16, 2024
1 parent 522c77e commit c833879
Show file tree
Hide file tree
Showing 28 changed files with 72 additions and 10 deletions.
1 change: 1 addition & 0 deletions locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>??.??.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Added an option to simplify the form of woman single surnames in extended mode (output without brackets if there are no other surnames).
<li>Added protection against problems with folders in Windows if the file name has a space before the extension.
<li>Added statistics type on parents' ages at child's birth.
<li>Fixed a frequent error saving images to cache "A generic error occurred in GDI+".
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>??.??.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Добавлена опция упрощения формы единственных фамилий женщин в расширенном режиме (вывод без скобок, если других фамилий нет).
<li>Добавлена защита от проблем с папками в Windows, если в имени файла перед расширением есть пробел.
<li>Добавлен тип статистики по возрастам родителей при рождении ребенка.
<li>Исправлена частая ошибка сохранения изображений в кэш "A generic error occurred in GDI+".
Expand Down
1 change: 1 addition & 0 deletions locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
1 change: 1 addition & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Удалить учетный номер "{0}"?
996=Архив не указан
997=Возраст родителей
998=Простая форма единственных фамилий
1 change: 1 addition & 0 deletions locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,4 @@
995=Are you sure you want to remove call number "{0}"?
996=Repository is not specified
997=Age of parents
998=Simple form of single surnames
6 changes: 6 additions & 0 deletions projects/GKCore/GKCore/Controllers/OptionsDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ public void UpdateWomanSurnameFormat()
GetControl<IRadioButton>("radMarried").Checked = true;
break;
}

GetControl<ICheckBox>("chkSimpleSingleSurnames").Checked = isExtend && fOptions.SimpleSingleSurnames;
GetControl<ICheckBox>("chkSimpleSingleSurnames").Enabled = isExtend;
}

public void ChangeExtendWomanSurnames()
Expand All @@ -308,6 +311,7 @@ public void ChangeExtendWomanSurnames()
GetControl<IRadioButton>("radMarried_Maiden").Enabled = true;
GetControl<IRadioButton>("radMaiden").Enabled = true;
GetControl<IRadioButton>("radMarried").Enabled = true;
GetControl<ICheckBox>("chkSimpleSingleSurnames").Enabled = true;
}
}

Expand All @@ -326,6 +330,7 @@ public void AcceptWomanSurnameFormat()
fOptions.WomanSurnameFormat = WomanSurnameFormat.wsfMarried;
}
}
fOptions.SimpleSingleSurnames = GetControl<ICheckBox>("chkSimpleSingleSurnames").Checked;
}

public void ResetInterfaceOptions()
Expand Down Expand Up @@ -993,6 +998,7 @@ public override void SetLocale()
GetControl<IRadioButton>("radMarried_Maiden").Text = LangMan.LS(LSID.WSF_Married_Maiden);
GetControl<IRadioButton>("radMaiden").Text = LangMan.LS(LSID.WSF_Maiden);
GetControl<IRadioButton>("radMarried").Text = LangMan.LS(LSID.WSF_Married);
GetControl<ICheckBox>("chkSimpleSingleSurnames").Text = LangMan.LS(LSID.SimpleSingleSurnames);

GetControl<ITabPage>("pageViewPersons").Text = LangMan.LS(LSID.ListPersons);
GetControl<IButton>("btnResetDefaults").Text = LangMan.LS(LSID.DefList);
Expand Down
20 changes: 16 additions & 4 deletions projects/GKCore/GKCore/GKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3544,22 +3544,34 @@ public static string GetFmtSurname(GDMSex iSex, GDMPersonalName personalName, st
var globOpts = GlobalOptions.Instance;

WomanSurnameFormat wsFmt = globOpts.WomanSurnameFormat;
bool simpleSingle = globOpts.SimpleSingleSurnames;

if (iSex == GDMSex.svFemale && wsFmt != WomanSurnameFormat.wsfNotExtend) {
string marriedSurname = personalName.MarriedName;
switch (wsFmt) {
case WomanSurnameFormat.wsfMaiden_Married:
result = defSurname;
simpleSingle = simpleSingle && string.IsNullOrEmpty(result);
if (marriedSurname.Length > 0) {
string op = (result.Length > 0) ? " (" : "(";
result = string.Concat(result, op, marriedSurname, ")");
if (!simpleSingle) {
string op = (result.Length > 0) ? " (" : "(";
result = string.Concat(result, op, marriedSurname, ")");
} else {
result = marriedSurname;
}
}
break;

case WomanSurnameFormat.wsfMarried_Maiden:
result = marriedSurname;
simpleSingle = simpleSingle && string.IsNullOrEmpty(result);
if (defSurname.Length > 0) {
string op = (result.Length > 0) ? " (" : "(";
result = string.Concat(result, op, defSurname, ")");
if (!simpleSingle) {
string op = (result.Length > 0) ? " (" : "(";
result = string.Concat(result, op, defSurname, ")");
} else {
result = defSurname;
}
}
break;

Expand Down
4 changes: 3 additions & 1 deletion projects/GKCore/GKCore/LangMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,9 @@ public enum LSID
/* 995 */ RemoveCallNumberQuery,
/* 996 */ RepositoryIsNotSpecified,
/* 997 */ ParentsAge,
/* 998 */ SimpleSingleSurnames,

/* 000 */ Last = ParentsAge
/* 000 */ Last = SimpleSingleSurnames
}


Expand Down Expand Up @@ -2099,6 +2100,7 @@ public static class LangMan
/* 995 */ "Are you sure you want to remove call number \"{0}\"?",
/* 996 */ "Repository is not specified",
/* 997 */ "Age of parents",
/* 998 */ "Simple form of single surnames",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down
7 changes: 5 additions & 2 deletions projects/GKCore/GKCore/Options/GlobalOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ public StringList ResidenceFilters
}

/// <summary>
/// Hidden option for non-standard order.
///
/// Initial implementation (now just default) for enumerating ATDs: from largest to smallest.
/// Reverse order of places: from smallest to largest.
///
Expand Down Expand Up @@ -295,6 +293,8 @@ public TreeChartOptions TreeChartOptions

public WomanSurnameFormat WomanSurnameFormat { get; set; }

public bool SimpleSingleSurnames { get; set; }


private GlobalOptions()
{
Expand Down Expand Up @@ -399,6 +399,7 @@ public void ResetDefaults_Interface()
SurnameFirstInOrder = true;
SurnameInCapitals = false;
WomanSurnameFormat = WomanSurnameFormat.wsfNotExtend;
SimpleSingleSurnames = false;
UseSurnamesInPersonSelectionFilter = false;
UseBirthDatesInPersonSelectionFilter = false;
ShowIndiAssociations = false;
Expand Down Expand Up @@ -769,6 +770,7 @@ public void LoadFromFile(IniFile ini)
AutosaveInterval = ini.ReadInteger("Common", "AutosaveInterval", 10);

WomanSurnameFormat = (WomanSurnameFormat)ini.ReadInteger("Common", "WomanSurnameFormat", 0);
SimpleSingleSurnames = ini.ReadBool("Common", "SimpleSingleSurnames", false);

Geocoder = ini.ReadString("Common", "Geocoder", "Google");
GeoSearchCountry = ini.ReadString("Common", "GeoSearchCountry", "");
Expand Down Expand Up @@ -908,6 +910,7 @@ public void SaveToFile(IniFile ini)
ini.WriteInteger("Common", "AutosaveInterval", AutosaveInterval);

ini.WriteInteger("Common", "WomanSurnameFormat", (int)WomanSurnameFormat);
ini.WriteBool("Common", "SimpleSingleSurnames", SimpleSingleSurnames);

ini.WriteString("Common", "Geocoder", Geocoder);
ini.WriteString("Common", "GeoSearchCountry", GeoSearchCountry);
Expand Down
20 changes: 17 additions & 3 deletions projects/GKv2/GEDKeeper2/GKUI/Forms/OptionsDlg.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions projects/GKv3/GEDKeeper3/GKUI/Forms/OptionsDlg.xeto
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@
<RadioButton x:Name="radMarried_Maiden" />
<RadioButton x:Name="radMaiden" />
<RadioButton x:Name="radMarried" />
<StackLayoutItem />
<CheckBox x:Name="chkSimpleSingleSurnames" />

</StackLayout>
</GroupBox>
Expand Down
2 changes: 2 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/OptionsDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@
<input:RadioButton x:Name="radMarried_Maiden" />
<input:RadioButton x:Name="radMaiden" />
<input:RadioButton x:Name="radMarried" />
<Label />
<input:CheckBox x:Name="chkSimpleSingleSurnames" />
</input:RadioButtonGroupView>
</comcom:GroupBox>

Expand Down

0 comments on commit c833879

Please sign in to comment.