Add a couple of phrases for group wallpapers.

This commit is contained in:
John Preston 2024-02-16 12:22:38 +04:00
parent 9f7ee3cafd
commit 18ca4a9eeb
3 changed files with 13 additions and 2 deletions

View file

@ -867,6 +867,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_background_sure_delete" = "Are you sure you want to delete this background?";
"lng_background_other_info" = "{user} will be able to apply this wallpaper";
"lng_background_other_channel" = "All subscribers will see this wallpaper";
"lng_background_other_group" = "All members will see this wallpaper";
"lng_background_apply1" = "Apply the wallpaper in this chat.";
"lng_background_apply2" = "Enjoy the view.";
"lng_background_apply_button" = "Apply For This Chat";
@ -876,6 +877,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_background_apply_me" = "Apply for me";
"lng_background_apply_both" = "Apply for me and {user}";
"lng_background_apply_channel" = "Apply For Channel";
"lng_background_apply_group" = "Apply For Group";
"lng_download_path_ask" = "Ask download path for each file";
"lng_download_path" = "Download path";

View file

@ -467,6 +467,10 @@ bool BackgroundPreviewBox::forChannel() const {
return _forPeer && _forPeer->isChannel();
}
bool BackgroundPreviewBox::forGroup() const {
return forChannel() && _forPeer->isMegagroup();
}
void BackgroundPreviewBox::generateBackground() {
if (_paper.backgroundColors().empty()) {
return;
@ -492,7 +496,9 @@ void BackgroundPreviewBox::resetTitle() {
void BackgroundPreviewBox::rebuildButtons(bool dark) {
clearButtons();
addButton(forChannel()
addButton(forGroup()
? tr::lng_background_apply_group()
: forChannel()
? tr::lng_background_apply_channel()
: _forPeer
? tr::lng_background_apply_button()
@ -1083,7 +1089,9 @@ void BackgroundPreviewBox::updateServiceBg(const std::vector<QColor> &bg) {
_service = GenerateServiceItem(
delegate(),
_serviceHistory,
(forChannel()
(forGroup()
? tr::lng_background_other_group(tr::now)
: forChannel()
? tr::lng_background_other_channel(tr::now)
: (_forPeer && !_fromMessageId)
? tr::lng_background_other_info(

View file

@ -95,6 +95,7 @@ private:
[[nodiscard]] OverridenStyle prepareOverridenStyle(bool dark);
[[nodiscard]] bool forChannel() const;
[[nodiscard]] bool forGroup() const;
void checkLevelForChannel();
void recreate(bool dark);