From db9cc5e301e0ebf5f8e5ec113dd93d0baeb782d0 Mon Sep 17 00:00:00 2001
From: Prasad <prasad@vtiger.com>
Date: Thu, 25 Apr 2024 11:56:05 +0530
Subject: [PATCH] Fixes #1828: Handle activity sub-type translation before
 adding to feed list

---
 layouts/v7/modules/Calendar/resources/Calendar.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/layouts/v7/modules/Calendar/resources/Calendar.js b/layouts/v7/modules/Calendar/resources/Calendar.js
index e1abaad42..98c114737 100644
--- a/layouts/v7/modules/Calendar/resources/Calendar.js
+++ b/layouts/v7/modules/Calendar/resources/Calendar.js
@@ -559,7 +559,11 @@ Vtiger.Class("Calendar_Calendar_Js", {
 					feedIndicatorTemplate.removeClass('.feed-indicator-template');
 					var newFeedIndicator = feedIndicatorTemplate.clone(true, true);
 					//replacing module name prefix with translated module name and concatinating with field name
-					feedIndicatorTitle = translatedModuleName + feedIndicatorTitle.substr(feedIndicatorTitle.indexOf('-'));
+					var feedIndicatorModuleEndIndex = feedIndicatorTitle.indexOf('('); // Events (ActivityType) - title...
+					if (feedIndicatorModuleEndIndex == -1) { // ModuleName - title...
+							feedIndicatorModuleEndIndex = feedInicatorTitle.indexOf('-');
+					}
+					feedIndicatorTitle = translatedModuleName + feedIndicatorTitle.substr(feedIndicatorModuleEndIndex);
 					newFeedIndicator.find('span:first').text(feedIndicatorTitle);
 					var newFeedCheckbox = newFeedIndicator.find('.toggleCalendarFeed');
 					newFeedCheckbox.attr('data-calendar-sourcekey', calendarSourceKey).
-- 
GitLab