Skip to content

Commit

Permalink
Added help language fallback (fix #536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Feb 28, 2024
1 parent 877d648 commit bf82fdc
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942={0} fotó hozzáadva innen: {1}.
943=Legfelső szintű linkek
944=Eltávolítja a legfelső szintű linket?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942={1} から {0} の写真を追加しました。
943=トップレベルのリンク
944=トップレベルのリンクを削除しますか?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942={0} Fotografien von {1} hinzugefügt.
943=Verweise auf oberster Ebene
944=Verweis auf oberster Ebene löschen?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
1 change: 1 addition & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Добавлено {0} фотографий из {1}.
943=Ссылки на верхний уровень
944=Удалить ссылку на верхний уровень?
945=Справка недоступна для этого языка. Будет показана справка на английском языке.
1 change: 1 addition & 0 deletions locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,4 @@
942=Added {0} photos from {1}.
943=Top level links
944=Remove top level link?
945=Help is not available for this language. An English help will be shown.
13 changes: 7 additions & 6 deletions projects/GKCore/GKCore/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,17 +678,18 @@ public void ShowHelpTopic(string topic)
if (string.IsNullOrEmpty(topic)) {
topic = "GEDKeeper.html";
}
topic = "help_" + lngSign + "/" + topic;
string topicWL = "help_" + lngSign + "/" + topic;

if (!HasFeatureSupport(Feature.Mobile)) {
string topicPath = GKUtils.GetLangsPath() + topic;
string topicPath = GKUtils.GetLangsPath() + topicWL;
if (!File.Exists(topicPath)) {
AppHost.StdDialogs.ShowError(@"For that language help is unavailable");
} else {
GKUtils.LoadExtFile(topicPath);
AppHost.StdDialogs.ShowError(LangMan.LS(LSID.HelpIsNotAvailable));
topicWL = "help_enu/" + topic;
topicPath = GKUtils.GetLangsPath() + topicWL;
}
GKUtils.LoadExtFile(topicPath);
} else {
string topicURL = GKData.APP_SITE + topic;
string topicURL = GKData.APP_SITE + topicWL;
OpenURL(topicURL);
}
}
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 @@ -1014,8 +1014,9 @@ public enum LSID
/* 942 */ AddedNPhotos,
/* 943 */ TopLevelLinks,
/* 944 */ RemoveTopLevelLinkQuery,
/* 945 */ HelpIsNotAvailable,

/* 000 */ Last = RemoveTopLevelLinkQuery
/* 000 */ Last = HelpIsNotAvailable
}


Expand Down Expand Up @@ -1983,6 +1984,7 @@ public static class LangMan
/* 942 */ "Added {0} photos from {1}.",
/* 943 */ "Top level links",
/* 944 */ "Remove top level link?",
/* 945 */ "Help is not available for this language. An English help will be shown.",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down

0 comments on commit bf82fdc

Please sign in to comment.