Skip to content

Commit

Permalink
fix(lang): also fix user import string in case of no imported users
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCatLady committed Mar 21, 2021
1 parent 3cbc14c commit c860049
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/UserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const messages = defineMessages({
importfromplex: 'Import Users from Plex',
importfromplexerror: 'Something went wrong while importing users from Plex.',
importedfromplex:
'{userCount, plural, =0 {No new users} one {# new user} other {# new users}} imported from Plex successfully!',
'{userCount, plural, one {# new user} other {# new users}} imported from Plex successfully!',
nouserstoimport: 'No new users to import from Plex.',
user: 'User',
totalrequests: 'Total Requests',
accounttype: 'Account Type',
Expand Down Expand Up @@ -171,9 +172,11 @@ const UserList: React.FC = () => {
'/api/v1/user/import-from-plex'
);
addToast(
intl.formatMessage(messages.importedfromplex, {
userCount: createdUsers.length,
}),
createdUsers.length
? intl.formatMessage(messages.importedfromplex, {
userCount: createdUsers.length,
})
: intl.formatMessage(messages.nouserstoimport),
{
autoDismiss: true,
appearance: 'success',
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,13 @@
"components.UserList.edit": "Edit",
"components.UserList.edituser": "Edit User Permissions",
"components.UserList.email": "Email Address",
"components.UserList.importedfromplex": "{userCount, plural, =0 {No new users} one {# new user} other {# new users}} imported from Plex successfully!",
"components.UserList.importedfromplex": "{userCount, plural, one {# new user} other {# new users}} imported from Plex successfully!",
"components.UserList.importfromplex": "Import Users from Plex",
"components.UserList.importfromplexerror": "Something went wrong while importing users from Plex.",
"components.UserList.lastupdated": "Last Updated",
"components.UserList.localuser": "Local User",
"components.UserList.next": "Next",
"components.UserList.nouserstoimport": "No new users to import from Plex.",
"components.UserList.owner": "Owner",
"components.UserList.password": "Password",
"components.UserList.passwordinfo": "Password Information",
Expand Down

0 comments on commit c860049

Please sign in to comment.