Skip to content

Commit 87764b3

Browse files
authored
Merge pull request Expensify#66771 from shubham1206agra/merge-translation-2
Merge beginningOfChat translations
2 parents 549b46a + d96b68c commit 87764b3

15 files changed

Lines changed: 288 additions & 329 deletions

File tree

src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
7171
];
7272
}
7373

74+
if (tnode.classes.includes('no-style-link')) {
75+
// If the link has a class of a no-style-link, we don't apply any styles
76+
linkStyle = {...(style as TextStyle)};
77+
delete linkStyle.color;
78+
delete linkStyle.textDecorationLine;
79+
delete linkStyle.textDecorationColor;
80+
}
81+
7482
return (
7583
<Text
7684
style={linkStyle}

src/components/ReportWelcomeText.tsx

Lines changed: 15 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import React, {useMemo} from 'react';
22
import {View} from 'react-native';
33
import type {OnyxEntry} from 'react-native-onyx';
4+
import useEnvironment from '@hooks/useEnvironment';
45
import useLocalize from '@hooks/useLocalize';
56
import useOnyx from '@hooks/useOnyx';
67
import useReportIsArchived from '@hooks/useReportIsArchived';
78
import useThemeStyles from '@hooks/useThemeStyles';
89
import Navigation from '@libs/Navigation/Navigation';
910
import {getPersonalDetailsForAccountIDs} from '@libs/OptionsListUtils';
10-
import {getPolicy} from '@libs/PolicyUtils';
1111
import {
12-
getDisplayNameForParticipant,
1312
getDisplayNamesWithTooltips,
1413
getParticipantsAccountIDsForDisplay,
1514
getPolicyName,
1615
getReportName,
17-
isAdminRoom as isAdminRoomReportUtils,
18-
isArchivedNonExpenseReport,
1916
isChatRoom as isChatRoomReportUtils,
2017
isConciergeChatReport,
2118
isInvoiceRoom as isInvoiceRoomReportUtils,
@@ -46,22 +43,20 @@ type ReportWelcomeTextProps = {
4643
function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
4744
const {translate} = useLocalize();
4845
const styles = useThemeStyles();
46+
const {environmentURL} = useEnvironment();
4947
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: false});
5048
const isPolicyExpenseChat = isPolicyExpenseChatReportUtils(report);
5149
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
5250
const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.reportID || undefined}`, {canBeMissing: true});
5351
const isReportArchived = useReportIsArchived(report?.reportID);
54-
const isArchivedRoom = isArchivedNonExpenseReport(report, isReportArchived);
5552
const isChatRoom = isChatRoomReportUtils(report);
5653
const isSelfDM = isSelfDMReportUtils(report);
5754
const isInvoiceRoom = isInvoiceRoomReportUtils(report);
5855
const isSystemChat = isSystemChatReportUtils(report);
59-
const isAdminRoom = isAdminRoomReportUtils(report);
60-
const isDefault = !(isChatRoom || isPolicyExpenseChat || isSelfDM || isInvoiceRoom || isSystemChat);
56+
const isDefault = !(isChatRoom || isPolicyExpenseChat || isSelfDM || isSystemChat);
6157
const participantAccountIDs = getParticipantsAccountIDsForDisplay(report, undefined, true, true, reportMetadata);
6258
const isMultipleParticipant = participantAccountIDs.length > 1;
6359
const displayNamesWithTooltips = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(participantAccountIDs, personalDetails), isMultipleParticipant);
64-
const welcomeMessage = SidebarUtils.getWelcomeMessage(report, policy, isReportArchived);
6560
const moneyRequestOptions = temporary_getMoneyRequestOptions(report, policy, participantAccountIDs);
6661
const policyName = getPolicyName({report});
6762

@@ -88,13 +83,13 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
8883
moneyRequestOptions.includes(CONST.IOU.TYPE.TRACK) ||
8984
moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT);
9085

91-
const navigateToReport = () => {
86+
const reportDetailsLink = useMemo(() => {
9287
if (!report?.reportID) {
93-
return;
88+
return '';
9489
}
9590

96-
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID, Navigation.getReportRHPActiveRoute()));
97-
};
91+
return `${environmentURL}/${ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID, Navigation.getReportRHPActiveRoute())}`;
92+
}, [environmentURL, report?.reportID]);
9893

9994
const welcomeHeroText = useMemo(() => {
10095
if (isInvoiceRoom) {
@@ -120,87 +115,28 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
120115
return translate('reportActionsView.sayHello');
121116
}, [isChatRoom, isInvoiceRoom, isPolicyExpenseChat, isSelfDM, isSystemChat, translate, policyName, reportName]);
122117

118+
const welcomeMessage = SidebarUtils.getWelcomeMessage(report, policy, isReportArchived, reportDetailsLink);
119+
123120
return (
124121
<>
125122
<View>
126123
<Text style={[styles.textHero]}>{welcomeHeroText}</Text>
127124
</View>
128125
<View style={[styles.mt3, styles.mw100]}>
129-
{isPolicyExpenseChat &&
130-
(welcomeMessage?.messageHtml ? (
131-
<View style={[styles.renderHTML, styles.cursorText]}>
132-
<RenderHTML html={welcomeMessage.messageHtml} />
133-
</View>
134-
) : (
135-
<Text>
136-
<Text>{welcomeMessage.phrase1}</Text>
137-
<Text style={[styles.textStrong]}>{getDisplayNameForParticipant({accountID: report?.ownerAccountID})}</Text>
138-
<Text>{welcomeMessage.phrase2}</Text>
139-
<Text style={[styles.textStrong]}>{getPolicyName({report})}</Text>
140-
<Text>{welcomeMessage.phrase3}</Text>
141-
</Text>
142-
))}
143-
{isInvoiceRoom &&
144-
!isArchivedRoom &&
145-
(welcomeMessage?.messageHtml ? (
146-
<View style={[styles.renderHTML, styles.cursorText]}>
147-
<RenderHTML html={welcomeMessage.messageHtml} />
148-
</View>
149-
) : (
150-
<Text>
151-
<Text>{welcomeMessage.phrase1}</Text>
152-
<Text>
153-
{report?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL ? (
154-
<Text style={[styles.textStrong]}>{getDisplayNameForParticipant({accountID: report?.invoiceReceiver?.accountID})}</Text>
155-
) : (
156-
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
157-
// eslint-disable-next-line deprecation/deprecation
158-
<Text style={[styles.textStrong]}>{getPolicy(report?.invoiceReceiver?.policyID)?.name}</Text>
159-
)}
160-
</Text>
161-
<Text>{` ${translate('common.and')} `}</Text>
162-
<Text style={[styles.textStrong]}>{getPolicyName({report})}</Text>
163-
<Text>{welcomeMessage.phrase2}</Text>
164-
</Text>
165-
))}
166-
{isChatRoom &&
167-
((!isInvoiceRoom && !isAdminRoom) || isArchivedRoom) &&
168-
(welcomeMessage?.messageHtml ? (
169-
<View style={styles.renderHTML}>
170-
<RenderHTML html={welcomeMessage.messageHtml} />
171-
</View>
172-
) : (
173-
<Text>
174-
<Text>{welcomeMessage.phrase1}</Text>
175-
{welcomeMessage.showReportName && (
176-
<Text
177-
style={[styles.textStrong]}
178-
onPress={navigateToReport}
179-
suppressHighlighting
180-
>
181-
{getReportName(report)}
182-
</Text>
183-
)}
184-
{welcomeMessage.phrase2 !== undefined && <Text>{welcomeMessage.phrase2}</Text>}
185-
</Text>
186-
))}
187-
{isChatRoom && isAdminRoom && !isArchivedRoom && (
188-
<Text>
189-
<Text>{welcomeMessage.phrase1}</Text>
190-
{welcomeMessage.phrase2 !== undefined && <Text style={styles.textStrong}>{welcomeMessage.phrase2}</Text>}
191-
{welcomeMessage.phrase3 !== undefined && <Text>{welcomeMessage.phrase3}</Text>}
192-
{welcomeMessage.phrase4 !== undefined && <Text>{welcomeMessage.phrase4}</Text>}
193-
</Text>
126+
{(isChatRoom || isPolicyExpenseChat) && !!welcomeMessage.messageHtml && (
127+
<View style={[styles.renderHTML, styles.cursorText]}>
128+
<RenderHTML html={welcomeMessage.messageHtml} />
129+
</View>
194130
)}
195131
{isSelfDM && (
196132
<Text>
197-
<Text>{welcomeMessage.phrase1}</Text>
133+
<Text>{welcomeMessage.messageText}</Text>
198134
{shouldShowUsePlusButtonText && <Text>{translate('reportActionsView.usePlusButton', {additionalText})}</Text>}
199135
</Text>
200136
)}
201137
{isSystemChat && (
202138
<Text>
203-
<Text>{welcomeMessage.phrase1}</Text>
139+
<Text>{welcomeMessage.messageText}</Text>
204140
</Text>
205141
)}
206142
{isDefault && displayNamesWithTooltips.length > 0 && (

src/languages/de.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ import type {
3535
AuthenticationErrorParams,
3636
AutoPayApprovedReportsLimitErrorParams,
3737
BadgeFreeTrialParams,
38-
BeginningOfChatHistoryAdminRoomPartOneParams,
39-
BeginningOfChatHistoryAnnounceRoomPartOneParams,
40-
BeginningOfChatHistoryDomainRoomPartOneParams,
38+
BeginningOfArchivedRoomParams,
39+
BeginningOfChatHistoryAdminRoomParams,
40+
BeginningOfChatHistoryAnnounceRoomParams,
41+
BeginningOfChatHistoryDomainRoomParams,
42+
BeginningOfChatHistoryInvoiceRoomParams,
43+
BeginningOfChatHistoryPolicyExpenseChatParams,
44+
BeginningOfChatHistoryUserRoomParams,
4145
BillingBannerCardAuthenticationRequiredParams,
4246
BillingBannerCardExpiredParams,
4347
BillingBannerCardOnDisputeParams,
@@ -827,25 +831,21 @@ const translations = {
827831
reactedWith: 'reagierte mit',
828832
},
829833
reportActionsView: {
830-
beginningOfArchivedRoomPartOne: 'Du hast die Party in verpasst.',
831-
beginningOfArchivedRoomPartTwo: ', hier gibt es nichts zu sehen.',
832-
beginningOfChatHistoryDomainRoomPartOne: ({domainRoom}: BeginningOfChatHistoryDomainRoomPartOneParams) =>
833-
`Dieser Chat ist mit allen Expensify-Mitgliedern in der ${domainRoom}-Domain.`,
834-
beginningOfChatHistoryDomainRoomPartTwo: 'Verwenden Sie es, um mit Kollegen zu chatten, Tipps auszutauschen und Fragen zu stellen.',
835-
beginningOfChatHistoryAdminRoomPartOneFirst: 'Dieser Chat ist mit',
836-
beginningOfChatHistoryAdminRoomPartOneLast: 'admin.',
837-
beginningOfChatHistoryAdminRoomWorkspaceName: ({workspaceName}: BeginningOfChatHistoryAdminRoomPartOneParams) => ` ${workspaceName} `,
838-
beginningOfChatHistoryAdminRoomPartTwo: 'Verwenden Sie es, um über die Einrichtung des Arbeitsplatzes und mehr zu chatten.',
839-
beginningOfChatHistoryAnnounceRoomPartOne: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartOneParams) => `Dieser Chat ist mit allen in ${workspaceName}.`,
840-
beginningOfChatHistoryAnnounceRoomPartTwo: `Verwenden Sie es für die wichtigsten Ankündigungen.`,
841-
beginningOfChatHistoryUserRoomPartOne: 'Dieser Chatraum ist für alles.',
842-
beginningOfChatHistoryUserRoomPartTwo: 'related.',
843-
beginningOfChatHistoryInvoiceRoomPartOne: `Dieser Chat ist für Rechnungen zwischen`,
844-
beginningOfChatHistoryInvoiceRoomPartTwo: `. Verwenden Sie die + Schaltfläche, um eine Rechnung zu senden.`,
834+
beginningOfArchivedRoom: ({reportName, reportDetailsLink}: BeginningOfArchivedRoomParams) =>
835+
`Du hast die Party in <strong><a class="no-style-link" href="${reportDetailsLink}">${reportName}</a></strong> verpasst, hier gibt es nichts zu sehen.`,
836+
beginningOfChatHistoryDomainRoom: ({domainRoom}: BeginningOfChatHistoryDomainRoomParams) =>
837+
`Dieser Chat ist für alle Expensify-Mitglieder auf der <strong>${domainRoom}</strong>-Domain. Nutzen Sie ihn, um mit Kollegen zu chatten, Tipps auszutauschen und Fragen zu stellen.`,
838+
beginningOfChatHistoryAdminRoom: ({workspaceName}: BeginningOfChatHistoryAdminRoomParams) =>
839+
`Dieser Chat ist mit dem <strong>${workspaceName}</strong>-Administrator. Nutzen Sie ihn, um über die Einrichtung von Arbeitsbereichen und mehr zu sprechen.`,
840+
beginningOfChatHistoryAnnounceRoom: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomParams) =>
841+
`Dieser Chat ist für alle im <strong>${workspaceName}</strong>. Benutze ihn für die wichtigsten Ankündigungen.`,
842+
beginningOfChatHistoryUserRoom: ({reportName, reportDetailsLink}: BeginningOfChatHistoryUserRoomParams) =>
843+
`Dieser Chatraum ist für alles, was mit <strong><a class="no-style-link" href="${reportDetailsLink}">${reportName}</a></strong> zu tun hat.`,
844+
beginningOfChatHistoryInvoiceRoom: ({invoicePayer, invoiceReceiver}: BeginningOfChatHistoryInvoiceRoomParams) =>
845+
`Dieser Chat ist für Rechnungen zwischen <strong>${invoicePayer}</strong> und <strong>${invoiceReceiver}</strong>. Verwenden Sie die Schaltfläche +, um eine Rechnung zu senden.`,
845846
beginningOfChatHistory: 'Dieser Chat ist mit',
846-
beginningOfChatHistoryPolicyExpenseChatPartOne: 'Dies ist, wo',
847-
beginningOfChatHistoryPolicyExpenseChatPartTwo: 'wird Ausgaben einreichen bei',
848-
beginningOfChatHistoryPolicyExpenseChatPartThree: '. Verwenden Sie einfach die + Taste.',
847+
beginningOfChatHistoryPolicyExpenseChat: ({workspaceName, submitterDisplayName}: BeginningOfChatHistoryPolicyExpenseChatParams) =>
848+
`Hier wird <strong>${submitterDisplayName}</strong> die Ausgaben an <strong>${workspaceName}</strong> übermitteln. Verwenden Sie einfach die Schaltfläche +.`,
849849
beginningOfChatHistorySelfDM: 'Dies ist Ihr persönlicher Bereich. Nutzen Sie ihn für Notizen, Aufgaben, Entwürfe und Erinnerungen.',
850850
beginningOfChatHistorySystemDM: 'Willkommen! Lassen Sie uns mit der Einrichtung beginnen.',
851851
chatWithAccountManager: 'Hier mit Ihrem Kundenbetreuer chatten',

src/languages/en.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ import type {
2323
AuthenticationErrorParams,
2424
AutoPayApprovedReportsLimitErrorParams,
2525
BadgeFreeTrialParams,
26-
BeginningOfChatHistoryAdminRoomPartOneParams,
27-
BeginningOfChatHistoryAnnounceRoomPartOneParams,
28-
BeginningOfChatHistoryDomainRoomPartOneParams,
26+
BeginningOfArchivedRoomParams,
27+
BeginningOfChatHistoryAdminRoomParams,
28+
BeginningOfChatHistoryAnnounceRoomParams,
29+
BeginningOfChatHistoryDomainRoomParams,
30+
BeginningOfChatHistoryInvoiceRoomParams,
31+
BeginningOfChatHistoryPolicyExpenseChatParams,
32+
BeginningOfChatHistoryUserRoomParams,
2933
BillingBannerCardAuthenticationRequiredParams,
3034
BillingBannerCardExpiredParams,
3135
BillingBannerCardOnDisputeParams,
@@ -816,24 +820,21 @@ const translations = {
816820
reactedWith: 'reacted with',
817821
},
818822
reportActionsView: {
819-
beginningOfArchivedRoomPartOne: 'You missed the party in ',
820-
beginningOfArchivedRoomPartTwo: ", there's nothing to see here.",
821-
beginningOfChatHistoryDomainRoomPartOne: ({domainRoom}: BeginningOfChatHistoryDomainRoomPartOneParams) => `This chat is with all Expensify members on the ${domainRoom} domain.`,
822-
beginningOfChatHistoryDomainRoomPartTwo: ' Use it to chat with colleagues, share tips, and ask questions.',
823-
beginningOfChatHistoryAdminRoomPartOneFirst: 'This chat is with',
824-
beginningOfChatHistoryAdminRoomPartOneLast: 'admin.',
825-
beginningOfChatHistoryAdminRoomWorkspaceName: ({workspaceName}: BeginningOfChatHistoryAdminRoomPartOneParams) => ` ${workspaceName} `,
826-
beginningOfChatHistoryAdminRoomPartTwo: ' Use it to chat about workspace setup and more.',
827-
beginningOfChatHistoryAnnounceRoomPartOne: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartOneParams) => `This chat is with everyone in ${workspaceName}.`,
828-
beginningOfChatHistoryAnnounceRoomPartTwo: ` Use it for the most important announcements.`,
829-
beginningOfChatHistoryUserRoomPartOne: 'This chat room is for anything ',
830-
beginningOfChatHistoryUserRoomPartTwo: ' related.',
831-
beginningOfChatHistoryInvoiceRoomPartOne: `This chat is for invoices between `,
832-
beginningOfChatHistoryInvoiceRoomPartTwo: `. Use the + button to send an invoice.`,
823+
beginningOfArchivedRoom: ({reportName, reportDetailsLink}: BeginningOfArchivedRoomParams) =>
824+
`You missed the party in <strong><a class="no-style-link" href="${reportDetailsLink}">${reportName}</a></strong>, there's nothing to see here.`,
825+
beginningOfChatHistoryDomainRoom: ({domainRoom}: BeginningOfChatHistoryDomainRoomParams) =>
826+
`This chat is with all Expensify members on the <strong>${domainRoom}</strong> domain. Use it to chat with colleagues, share tips, and ask questions.`,
827+
beginningOfChatHistoryAdminRoom: ({workspaceName}: BeginningOfChatHistoryAdminRoomParams) =>
828+
`This chat is with <strong>${workspaceName}</strong> admin. Use it to chat about workspace setup and more.`,
829+
beginningOfChatHistoryAnnounceRoom: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomParams) =>
830+
`This chat is with everyone in <strong>${workspaceName}</strong>. Use it for the most important announcements.`,
831+
beginningOfChatHistoryUserRoom: ({reportName, reportDetailsLink}: BeginningOfChatHistoryUserRoomParams) =>
832+
`This chat room is for anything <strong><a class="no-style-link" href="${reportDetailsLink}">${reportName}</a></strong> related.`,
833+
beginningOfChatHistoryInvoiceRoom: ({invoicePayer, invoiceReceiver}: BeginningOfChatHistoryInvoiceRoomParams) =>
834+
`This chat is for invoices between <strong>${invoicePayer}</strong> and <strong>${invoiceReceiver}</strong>. Use the + button to send an invoice.`,
833835
beginningOfChatHistory: 'This chat is with ',
834-
beginningOfChatHistoryPolicyExpenseChatPartOne: 'This is where ',
835-
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' will submit expenses to ',
836-
beginningOfChatHistoryPolicyExpenseChatPartThree: '. Just use the + button.',
836+
beginningOfChatHistoryPolicyExpenseChat: ({workspaceName, submitterDisplayName}: BeginningOfChatHistoryPolicyExpenseChatParams) =>
837+
`This is where <strong>${submitterDisplayName}</strong> will submit expenses to <strong>${workspaceName}</strong>. Just use the + button.`,
837838
beginningOfChatHistorySelfDM: 'This is your personal space. Use it for notes, tasks, drafts, and reminders.',
838839
beginningOfChatHistorySystemDM: "Welcome! Let's get you set up.",
839840
chatWithAccountManager: 'Chat with your account manager here',

0 commit comments

Comments
 (0)