Skip to content

Commit

Permalink
Show error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Oct 22, 2024
1 parent 8653a12 commit 00773a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
) => {
if (!leaderboards) {
if (!isOnline)
return 'Unable to fetch leaderboards as you are offline.';
return 'Your game may not be registered, create one in the leaderboard manager.';
return i18n._(
t`Unable to fetch leaderboards as you are offline.`
);
return i18n._(
t`Your game may not be registered, create one in the leaderboard manager.`
);
}
}}
/>
Expand Down
14 changes: 13 additions & 1 deletion newIDE/app/src/PropertiesEditor/LeaderboardIdPropertyField.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import React from 'react';
import { t } from '@lingui/macro';
import { t, Trans } from '@lingui/macro';
import { I18n } from '@lingui/react';
import SelectField, { type SelectFieldInterface } from '../UI/SelectField';
import SelectOption from '../UI/SelectOption';
Expand Down Expand Up @@ -121,6 +121,18 @@ export default React.forwardRef<Props, LeaderboardIdPropertyFieldInterface>(
helperMarkdownText={props.helperMarkdownText}
multiline
style={props.fieldStyle}
errorText={
leaderboards ? null : isOnline ? (
<Trans>
Your game may not be registered, create one in the
leaderboard manager.
</Trans>
) : (
<Trans>
Unable to fetch leaderboards as you are offline.
</Trans>
)
}
/>
)
}
Expand Down

0 comments on commit 00773a0

Please sign in to comment.