@@ -1177,6 +1177,23 @@ Onyx.connect({
11771177 },
11781178});
11791179
1180+ let hiddenTranslation = '';
1181+ let unavailableTranslation = '';
1182+
1183+ Onyx.connect({
1184+ key: ONYXKEYS.ARE_TRANSLATIONS_LOADING,
1185+ initWithStoredValues: false,
1186+ callback: (value) => {
1187+ if (value ?? true) {
1188+ return;
1189+ }
1190+ // eslint-disable-next-line @typescript-eslint/no-deprecated
1191+ hiddenTranslation = translateLocal('common.hidden');
1192+ // eslint-disable-next-line @typescript-eslint/no-deprecated
1193+ unavailableTranslation = translateLocal('workspace.common.unavailable');
1194+ },
1195+ });
1196+
11801197function getCurrentUserAvatar(): AvatarSource | undefined {
11811198 return currentUserPersonalDetails?.avatar;
11821199}
@@ -1320,8 +1337,7 @@ function getPolicyType(report: OnyxInputOrEntry<Report>, policies: OnyxCollectio
13201337 * Get the policy name from a given report
13211338 */
13221339function getPolicyName({report, returnEmptyIfNotFound = false, policy, policies, reports}: GetPolicyNameParams): string {
1323- // eslint-disable-next-line @typescript-eslint/no-deprecated
1324- const noPolicyFound: string = returnEmptyIfNotFound ? '' : translateLocal('workspace.common.unavailable');
1340+ const noPolicyFound = returnEmptyIfNotFound ? '' : unavailableTranslation;
13251341 const parentReport = report ? getRootParentReport({report, reports}) : undefined;
13261342
13271343 if (isEmptyObject(report) || (isEmptyObject(policies) && isEmptyObject(allPolicies) && !report?.policyName && !parentReport?.policyName)) {
@@ -3107,8 +3123,7 @@ function getDisplayNameForParticipant({
31073123 }
31083124
31093125 // If the user's personal details (first name) should be hidden, make sure we return "hidden" instead of the short name
3110- // eslint-disable-next-line @typescript-eslint/no-deprecated
3111- if (shouldFallbackToHidden && longName === translateLocal('common.hidden')) {
3126+ if (shouldFallbackToHidden && longName === hiddenTranslation) {
31123127 return longName;
31133128 }
31143129
0 commit comments