@@ -33,7 +33,7 @@ import {
33
33
} from '../webworker/workers/browser/libsession_worker_interface' ;
34
34
import { assertUnreachable } from '../types/sqlSharedTypes' ;
35
35
import { isUsAnySogsFromCache } from '../session/apis/open_group_api/sogsv3/knownBlindedkeys' ;
36
- import { localize } from '../localization/localeTools' ;
36
+ import { tr } from '../localization/localeTools' ;
37
37
38
38
const AvatarContainer = styled . div `
39
39
position: relative;
@@ -169,29 +169,29 @@ const StyledGroupStatusText = styled.span<{ isFailure: boolean }>`
169
169
function localisedStatusFromMemberStatus ( memberStatus : MemberStateGroupV2 ) {
170
170
switch ( memberStatus ) {
171
171
case 'INVITE_FAILED' :
172
- return window . i18n ( 'groupInviteFailed' ) ;
172
+ return tr ( 'groupInviteFailed' ) ;
173
173
case 'INVITE_NOT_SENT' :
174
- return window . i18n ( 'groupInviteNotSent' ) ;
174
+ return tr ( 'groupInviteNotSent' ) ;
175
175
case 'INVITE_SENDING' :
176
- return window . i18n ( 'groupInviteSending' , { count : 1 } ) ;
176
+ return tr ( 'groupInviteSending' , { count : 1 } ) ;
177
177
case 'INVITE_SENT' :
178
- return window . i18n ( 'groupInviteSent' ) ;
178
+ return tr ( 'groupInviteSent' ) ;
179
179
case 'INVITE_UNKNOWN' : // fallback, hopefully won't happen in production
180
- return window . i18n ( 'groupInviteStatusUnknown' ) ;
180
+ return tr ( 'groupInviteStatusUnknown' ) ;
181
181
case 'PROMOTION_UNKNOWN' : // fallback, hopefully won't happen in production
182
- return window . i18n ( 'adminPromotionStatusUnknown' ) ;
182
+ return tr ( 'adminPromotionStatusUnknown' ) ;
183
183
case 'REMOVED_UNKNOWN' : // fallback, hopefully won't happen in production
184
184
case 'REMOVED_MEMBER' : // we want pending removal members at the end of the "invite" states
185
185
case 'REMOVED_MEMBER_AND_MESSAGES' :
186
- return window . i18n ( 'groupPendingRemoval' ) ;
186
+ return tr ( 'groupPendingRemoval' ) ;
187
187
case 'PROMOTION_FAILED' :
188
- return window . i18n ( 'adminPromotionFailed' ) ;
188
+ return tr ( 'adminPromotionFailed' ) ;
189
189
case 'PROMOTION_NOT_SENT' :
190
- return window . i18n ( 'adminPromotionNotSent' ) ;
190
+ return tr ( 'adminPromotionNotSent' ) ;
191
191
case 'PROMOTION_SENDING' :
192
- return window . i18n ( 'adminSendingPromotion' , { count : 1 } ) ;
192
+ return tr ( 'adminSendingPromotion' , { count : 1 } ) ;
193
193
case 'PROMOTION_SENT' :
194
- return window . i18n ( 'adminPromotionSent' ) ;
194
+ return tr ( 'adminPromotionSent' ) ;
195
195
case 'PROMOTION_ACCEPTED' :
196
196
return null ; // no statuses for accepted state;
197
197
case 'INVITE_ACCEPTED' :
@@ -269,7 +269,7 @@ const ResendButton = ({ groupPk, pubkey }: { pubkey: PubkeyType; groupPk: GroupP
269
269
dataTestId = { 'resend-invite-button' }
270
270
buttonShape = { SessionButtonShape . Square }
271
271
buttonType = { SessionButtonType . Solid }
272
- text = { window . i18n ( 'resend' ) }
272
+ text = { tr ( 'resend' ) }
273
273
disabled = { resendButtonDisabled }
274
274
onClick = { async ( ) => {
275
275
const group = await UserGroupsWrapperActions . getGroup ( groupPk ) ;
@@ -311,7 +311,7 @@ const PromoteButton = ({ groupPk, pubkey }: { pubkey: PubkeyType; groupPk: Group
311
311
buttonShape = { SessionButtonShape . Square }
312
312
buttonType = { SessionButtonType . Solid }
313
313
buttonColor = { SessionButtonColor . Danger }
314
- text = { window . i18n ( 'promote' ) }
314
+ text = { tr ( 'promote' ) }
315
315
onClick = { ( ) => {
316
316
void promoteUsersInGroup ( {
317
317
groupPk,
@@ -342,7 +342,7 @@ export const MemberListItem = <T extends string>({
342
342
} : MemberListItemProps < T > ) => {
343
343
const memberName = useNicknameOrProfileNameOrShortenedPubkey ( pubkey ) ;
344
344
const isYou = isUsAnySogsFromCache ( pubkey ) ;
345
- const ourName = isYou ? localize ( 'you' ) . toString ( ) : null ;
345
+ const ourName = isYou ? tr ( 'you' ) : null ;
346
346
const shortPubkey = PubKey . shorten ( pubkey ) ;
347
347
const nameSuffix =
348
348
isPublic && inMentions && ! isYou && memberName !== shortPubkey ? shortPubkey : '' ;
0 commit comments