Skip to content

Commit 5db3a18

Browse files
authored
fix: Persian language (#555)
* fix: corrected typos comfirm -> confirm varaint -> variant Privilaged -> Privileged courseare, coursweare -> courseware Discssion -> Discussion dimentions -> dimensions * refactor: clean up language codes
1 parent 3a6a783 commit 5db3a18

25 files changed

+75
-75
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export TRANSIFEX_RESOURCE = frontend-app-discussions
22
transifex_resource = frontend-app-discussions
3-
transifex_langs = "ar,fr,es_419,zh_CN,tr_TR,pl,fr_CA,fr_FR,de_DE,it_IT,pt_PT,uk,ru,hi,cs,es_AR,es_ES,fa_IR"
3+
transifex_langs = "ar,cs,de_DE,es_419,es_AR,es_ES,fa_IR,fr,fr_CA,fr_FR,hi,it_IT,pl,pt_PT,tr_TR,uk,ru,zh_CN"
44

55
intl_imports = ./node_modules/.bin/intl-imports.js
66
transifex_utils = ./node_modules/.bin/transifex-utils.js

src/discussions/common/ActionsDropdown.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const ActionsDropdown = ({
6868
disabled={disabled}
6969
size={iconSize}
7070
ref={buttonRef}
71-
iconClassNames={dropDownIconSize ? 'dropdown-icon-dimentions' : ''}
71+
iconClassNames={dropDownIconSize ? 'dropdown-icon-dimensions' : ''}
7272
/>
7373
<div className="actions-dropdown">
7474
<ModalPopup

src/discussions/common/Confirmation.jsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const Confirmation = ({
1111
title,
1212
description,
1313
onClose,
14-
comfirmAction,
15-
closeButtonVaraint,
14+
confirmAction,
15+
closeButtonVariant,
1616
confirmButtonVariant,
1717
confirmButtonText,
1818
}) => {
@@ -30,10 +30,10 @@ const Confirmation = ({
3030
</ModalDialog.Body>
3131
<ModalDialog.Footer>
3232
<ActionRow>
33-
<ModalDialog.CloseButton variant={closeButtonVaraint}>
33+
<ModalDialog.CloseButton variant={closeButtonVariant}>
3434
{intl.formatMessage(messages.confirmationCancel)}
3535
</ModalDialog.CloseButton>
36-
<Button variant={confirmButtonVariant} onClick={comfirmAction}>
36+
<Button variant={confirmButtonVariant} onClick={confirmAction}>
3737
{ confirmButtonText || intl.formatMessage(messages.confirmationConfirm)}
3838
</Button>
3939
</ActionRow>
@@ -45,16 +45,16 @@ const Confirmation = ({
4545
Confirmation.propTypes = {
4646
isOpen: PropTypes.bool.isRequired,
4747
onClose: PropTypes.func.isRequired,
48-
comfirmAction: PropTypes.func.isRequired,
48+
confirmAction: PropTypes.func.isRequired,
4949
title: PropTypes.string.isRequired,
5050
description: PropTypes.string.isRequired,
51-
closeButtonVaraint: PropTypes.string,
51+
closeButtonVariant: PropTypes.string,
5252
confirmButtonVariant: PropTypes.string,
5353
confirmButtonText: PropTypes.string,
5454
};
5555

5656
Confirmation.defaultProps = {
57-
closeButtonVaraint: 'default',
57+
closeButtonVariant: 'default',
5858
confirmButtonVariant: 'primary',
5959
confirmButtonText: '',
6060
};

src/discussions/common/HoverCard.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ const HoverCard = ({
3131
const intl = useIntl();
3232
const { enableInContextSidebar } = useContext(DiscussionContext);
3333
const { isClosed } = useContext(PostCommentsContext);
34-
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
34+
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
3535

3636
return (
3737
<div
3838
className="flex-fill justify-content-end align-items-center hover-card mr-n4 position-absolute"
3939
data-testid={`hover-card-${id}`}
4040
id={`hover-card-${id}`}
4141
>
42-
{isUserPrivilagedInPostingRestriction && (
42+
{isUserPrivilegedInPostingRestriction && (
4343
<div className="d-flex">
4444
<Button
4545
variant="tertiary"
@@ -85,7 +85,7 @@ const HoverCard = ({
8585
iconAs={Icon}
8686
size="sm"
8787
alt="Like"
88-
iconClassNames="like-icon-dimentions"
88+
iconClassNames="like-icon-dimensions"
8989
onClick={(e) => {
9090
e.preventDefault();
9191
onLike();
@@ -99,7 +99,7 @@ const HoverCard = ({
9999
iconAs={Icon}
100100
size="sm"
101101
alt="Follow"
102-
iconClassNames="follow-icon-dimentions"
102+
iconClassNames="follow-icon-dimensions"
103103
onClick={(e) => {
104104
e.preventDefault();
105105
onFollow();

src/discussions/data/hooks.test.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ describe('Hooks', () => {
104104

105105
describe('useUserPostingEnabled', () => {
106106
const ComponentWithHook = () => {
107-
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
107+
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
108108
return (
109109
<div>
110-
{String(isUserPrivilagedInPostingRestriction)}
110+
{String(isUserPrivilegedInPostingRestriction)}
111111
</div>
112112
);
113113
};

src/discussions/data/selectors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const selectUserIsStaff = state => state.config.isUserAdmin;
1212

1313
export const selectUserIsGroupTa = state => state.config.isGroupTa;
1414

15-
export const selectconfigLoadingStatus = state => state.config.status;
15+
export const selectConfigLoadingStatus = state => state.config.status;
1616

1717
export const selectLearnersTabEnabled = state => state.config.learnersTabEnabled;
1818

src/discussions/discussions-home/DiscussionSidebar.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { DiscussionContext } from '../common/context';
1717
import {
1818
useContainerSize, useIsOnDesktop, useIsOnXLDesktop, useShowLearnersTab,
1919
} from '../data/hooks';
20-
import { selectconfigLoadingStatus, selectEnableInContext } from '../data/selectors';
20+
import { selectConfigLoadingStatus, selectEnableInContext } from '../data/selectors';
2121

2222
const TopicPostsView = lazy(() => import('../in-context-topics/TopicPostsView'));
2323
const InContextTopicsView = lazy(() => import('../in-context-topics/TopicsView'));
@@ -32,7 +32,7 @@ const DiscussionSidebar = ({ displaySidebar, postActionBarRef }) => {
3232
const isOnXLDesktop = useIsOnXLDesktop();
3333
const { enableInContextSidebar } = useContext(DiscussionContext);
3434
const enableInContext = useSelector(selectEnableInContext);
35-
const configStatus = useSelector(selectconfigLoadingStatus);
35+
const configStatus = useSelector(selectConfigLoadingStatus);
3636
const redirectToLearnersTab = useShowLearnersTab();
3737
const sidebarRef = useRef(null);
3838
const postActionBarHeight = useContainerSize(postActionBarRef);

src/discussions/discussions-home/DiscussionsHome.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const DiscussionsHome = () => {
5555
useFeedbackWrapper();
5656
/* Display the content area if we are currently viewing/editing a post or creating one.
5757
If the window is larger than a particular size, show the sidebar for navigating between posts/topics.
58-
However, for smaller screens or embeds, onlyshow the sidebar if the content area isn't displayed. */
58+
However, for smaller screens or embeds, only show the sidebar if the content area isn't displayed. */
5959
const displayContentArea = (postId || postEditorVisible || (learnerUsername && postId));
6060
if (displayContentArea) { displaySidebar = isOnDesktop; }
6161

src/discussions/discussions-home/DiscussionsRestrictionBanner.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { useIntl } from '@edx/frontend-platform/i18n';
66
import { PageBanner } from '@edx/paragon';
77

88
import { RequestStatus } from '../../data/constants';
9-
import { selectconfigLoadingStatus, selectIsPostingEnabled } from '../data/selectors';
9+
import { selectConfigLoadingStatus, selectIsPostingEnabled } from '../data/selectors';
1010
import messages from '../messages';
1111

1212
const DiscussionsRestrictionBanner = () => {
1313
const intl = useIntl();
1414
const isPostingEnabled = useSelector(selectIsPostingEnabled);
15-
const configLoadingStatus = useSelector(selectconfigLoadingStatus);
15+
const configLoadingStatus = useSelector(selectConfigLoadingStatus);
1616
const [showBanner, setShowBanner] = useState(true);
1717

1818
const handleDismiss = useCallback(() => {

src/discussions/discussions-home/FeedbackWrapper.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { logError } from '@edx/frontend-platform/logging';
77

88
import { RequestStatus } from '../../data/constants';
99
import {
10-
selectconfigLoadingStatus,
10+
selectConfigLoadingStatus,
1111
selectIsCourseAdmin,
1212
selectIsCourseStaff,
1313
selectUserIsGroupTa,
@@ -19,7 +19,7 @@ export default function useFeedbackWrapper() {
1919
const isUserGroupTA = useSelector(selectUserIsGroupTa);
2020
const isCourseAdmin = useSelector(selectIsCourseAdmin);
2121
const isCourseStaff = useSelector(selectIsCourseStaff);
22-
const configStatus = useSelector(selectconfigLoadingStatus);
22+
const configStatus = useSelector(selectConfigLoadingStatus);
2323

2424
useEffect(() => {
2525
if (configStatus === RequestStatus.SUCCESSFUL) {

src/discussions/empty-posts/EmptyPosts.test.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('EmptyPage', () => {
5757
store = initializeStore();
5858
});
5959

60-
test('"posts youve interacted with" message shown when no posts in system', async () => {
60+
test('"posts you\'ve interacted with" message shown when no posts in system', async () => {
6161
renderComponent(`/${courseId}/my-posts/`);
6262
expect(
6363
screen.queryByText(messages.emptyMyPosts.defaultMessage),

src/discussions/learners/LearnersView.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Button, Spinner } from '@edx/paragon';
1010

1111
import SearchInfo from '../../components/SearchInfo';
1212
import { RequestStatus, Routes } from '../../data/constants';
13-
import { selectconfigLoadingStatus, selectLearnersTabEnabled } from '../data/selectors';
13+
import { selectConfigLoadingStatus, selectLearnersTabEnabled } from '../data/selectors';
1414
import NoResults from '../posts/NoResults';
1515
import {
1616
learnersLoadingStatus,
@@ -33,7 +33,7 @@ const LearnersView = () => {
3333
const nextPage = useSelector(selectLearnerNextPage());
3434
const loadingStatus = useSelector(learnersLoadingStatus());
3535
const usernameSearch = useSelector(selectUsernameSearch());
36-
const courseConfigLoadingStatus = useSelector(selectconfigLoadingStatus);
36+
const courseConfigLoadingStatus = useSelector(selectConfigLoadingStatus);
3737
const learnersTabEnabled = useSelector(selectLearnersTabEnabled);
3838
const learners = useSelector(selectAllLearners);
3939

src/discussions/post-comments/comments/CommentsView.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const CommentsView = ({ endorsed }) => {
1616
const intl = useIntl();
1717
const [addingResponse, setAddingResponse] = useState(false);
1818
const { isClosed } = useContext(PostCommentsContext);
19-
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
19+
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
2020

2121
const {
2222
endorsedCommentsIds,
@@ -66,7 +66,7 @@ const CommentsView = ({ endorsed }) => {
6666
)}
6767
{isLoading && !showLoadMoreResponses && (
6868
<div className="mb-2 mt-3 d-flex justify-content-center">
69-
<Spinner animation="border" variant="primary" className="spinner-dimentions" />
69+
<Spinner animation="border" variant="primary" className="spinner-dimensions" />
7070
</div>
7171
)}
7272
</div>
@@ -90,7 +90,7 @@ const CommentsView = ({ endorsed }) => {
9090
{handleDefinition(messages.responseCount, unEndorsedCommentsIds.length)}
9191
{unEndorsedCommentsIds.length === 0 && <br />}
9292
{handleComments(unEndorsedCommentsIds, false)}
93-
{(isUserPrivilagedInPostingRestriction && !!unEndorsedCommentsIds.length && !isClosed) && (
93+
{(isUserPrivilegedInPostingRestriction && !!unEndorsedCommentsIds.length && !isClosed) && (
9494
<div className="mx-4">
9595
{!addingResponse && (
9696
<Button

src/discussions/post-comments/comments/comment/Comment.jsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const Comment = ({
6161
const currentPage = useSelector(selectCommentCurrentPage(id));
6262
const sortedOrder = useSelector(selectCommentSortOrder);
6363
const actions = useActions(ContentTypes.COMMENT, id);
64-
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
64+
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
6565

6666
useEffect(() => {
6767
// If the comment has a parent comment, it won't have any children, so don't fetch them.
@@ -119,10 +119,10 @@ const Comment = ({
119119
), [id, currentPage, sortedOrder]);
120120

121121
const handleAddCommentButton = useCallback(() => {
122-
if (isUserPrivilagedInPostingRestriction) {
122+
if (isUserPrivilegedInPostingRestriction) {
123123
setReplying(true);
124124
}
125-
}, [isUserPrivilagedInPostingRestriction]);
125+
}, [isUserPrivilegedInPostingRestriction]);
126126

127127
const handleCommentLike = useCallback(async () => {
128128
await dispatch(editComment(id, { voted: !voted }));
@@ -154,8 +154,8 @@ const Comment = ({
154154
title={intl.formatMessage(messages.deleteResponseTitle)}
155155
description={intl.formatMessage(messages.deleteResponseDescription)}
156156
onClose={hideDeleteConfirmation}
157-
comfirmAction={handleDeleteConfirmation}
158-
closeButtonVaraint="tertiary"
157+
confirmAction={handleDeleteConfirmation}
158+
closeButtonVariant="tertiary"
159159
confirmButtonText={intl.formatMessage(messages.deleteConfirmationDelete)}
160160
/>
161161
{!abuseFlagged && (
@@ -164,7 +164,7 @@ const Comment = ({
164164
title={intl.formatMessage(messages.reportResponseTitle)}
165165
description={intl.formatMessage(messages.reportResponseDescription)}
166166
onClose={hideReportConfirmation}
167-
comfirmAction={handleReportConfirmation}
167+
confirmAction={handleReportConfirmation}
168168
confirmButtonVariant="danger"
169169
/>
170170
)}
@@ -265,7 +265,7 @@ const Comment = ({
265265
/>
266266
</div>
267267
) : (
268-
!isClosed && isUserPrivilagedInPostingRestriction && (inlineReplies.length >= 5) && (
268+
!isClosed && isUserPrivilegedInPostingRestriction && (inlineReplies.length >= 5) && (
269269
<Button
270270
className="d-flex flex-grow mt-2 font-size-14 font-style font-weight-500 text-primary-500"
271271
variant="plain"

src/discussions/post-comments/comments/comment/Reply.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ const Reply = ({ responseId }) => {
8383
title={intl.formatMessage(messages.deleteCommentTitle)}
8484
description={intl.formatMessage(messages.deleteCommentDescription)}
8585
onClose={hideDeleteConfirmation}
86-
comfirmAction={handleDeleteConfirmation}
87-
closeButtonVaraint="tertiary"
86+
confirmAction={handleDeleteConfirmation}
87+
closeButtonVariant="tertiary"
8888
confirmButtonText={intl.formatMessage(messages.deleteConfirmationDelete)}
8989
/>
9090
{!abuseFlagged && (
@@ -93,7 +93,7 @@ const Reply = ({ responseId }) => {
9393
title={intl.formatMessage(messages.reportCommentTitle)}
9494
description={intl.formatMessage(messages.reportCommentDescription)}
9595
onClose={hideReportConfirmation}
96-
comfirmAction={handleReportConfirmation}
96+
confirmAction={handleReportConfirmation}
9797
confirmButtonVariant="danger"
9898
/>
9999
)}

src/discussions/posts/PostsList.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Button, Spinner } from '@edx/paragon';
1111

1212
import { RequestStatus } from '../../data/constants';
1313
import { DiscussionContext } from '../common/context';
14-
import { selectconfigLoadingStatus, selectUserHasModerationPrivileges, selectUserIsStaff } from '../data/selectors';
14+
import { selectConfigLoadingStatus, selectUserHasModerationPrivileges, selectUserIsStaff } from '../data/selectors';
1515
import { fetchUserPosts } from '../learners/data/thunks';
1616
import messages from '../messages';
1717
import { usePostList } from './data/hooks';
@@ -35,7 +35,7 @@ const PostsList = ({
3535
const nextPage = useSelector(selectThreadNextPage());
3636
const userHasModerationPrivileges = useSelector(selectUserHasModerationPrivileges);
3737
const userIsStaff = useSelector(selectUserIsStaff);
38-
const configStatus = useSelector(selectconfigLoadingStatus);
38+
const configStatus = useSelector(selectConfigLoadingStatus);
3939
const sortedPostsIds = usePostList(postsIds);
4040
const showOwnPosts = page === 'my-posts';
4141

src/discussions/posts/post-actions-bar/PostActionsBar.jsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Search from '../../../components/Search';
1313
import { RequestStatus } from '../../../data/constants';
1414
import { DiscussionContext } from '../../common/context';
1515
import { useUserPostingEnabled } from '../../data/hooks';
16-
import { selectconfigLoadingStatus, selectEnableInContext } from '../../data/selectors';
16+
import { selectConfigLoadingStatus, selectEnableInContext } from '../../data/selectors';
1717
import { TopicSearchBar as IncontextSearch } from '../../in-context-topics/topic-search';
1818
import { postMessageToParent } from '../../utils';
1919
import { showPostEditor } from '../data';
@@ -24,9 +24,9 @@ import './actionBar.scss';
2424
const PostActionsBar = () => {
2525
const intl = useIntl();
2626
const dispatch = useDispatch();
27-
const loadingStatus = useSelector(selectconfigLoadingStatus);
27+
const loadingStatus = useSelector(selectConfigLoadingStatus);
2828
const enableInContext = useSelector(selectEnableInContext);
29-
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
29+
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
3030
const { enableInContextSidebar, page } = useContext(DiscussionContext);
3131

3232
const handleCloseInContext = useCallback(() => {
@@ -49,7 +49,7 @@ const PostActionsBar = () => {
4949
{intl.formatMessage(messages.title)}
5050
</h4>
5151
)}
52-
{loadingStatus === RequestStatus.SUCCESSFUL && isUserPrivilagedInPostingRestriction && (
52+
{loadingStatus === RequestStatus.SUCCESSFUL && isUserPrivilegedInPostingRestriction && (
5353
<>
5454
{!enableInContextSidebar && <div className="border-right border-light-400 mx-3" />}
5555
<Button
@@ -74,8 +74,8 @@ const PostActionsBar = () => {
7474
iconAs={Icon}
7575
onClick={handleCloseInContext}
7676
alt={intl.formatMessage(messages.close)}
77-
iconClassNames="spinner-dimentions"
78-
className="spinner-dimentions"
77+
iconClassNames="spinner-dimensions"
78+
className="spinner-dimensions"
7979
/>
8080
</div>
8181
</>

src/discussions/posts/post-editor/PostEditor.test.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('PostEditor', () => {
118118
expect(screen.queryAllByRole('radio')).toHaveLength(2);
119119
// 2 categories with 4 subcategories each
120120
expect(screen.queryAllByText(/category-\d-topic \d/)).toHaveLength(8);
121-
// 3 non courseare topics
121+
// 3 non courseware topics
122122
expect(screen.queryAllByText(/ncw-topic \d/)).toHaveLength(3);
123123
expect(screen.queryByText('cohort', { exact: false })).not.toBeInTheDocument();
124124
expect(screen.queryByText('Post anonymously')).not.toBeInTheDocument();
@@ -199,7 +199,7 @@ describe('PostEditor', () => {
199199
await renderComponent();
200200
// Initially the user can't select a cohort
201201
expect(screen.queryByRole('combobox', { name: /cohort visibility/i })).not.toBeInTheDocument();
202-
// All coursweare topics are divided
202+
// All courseware topics are divided
203203
[1, 2].forEach(catId => {
204204
[1, 2, 3, 4].forEach((topicId) => {
205205
act(() => {

src/discussions/posts/post/LikeButton.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ const LikeButton = ({ count, onClick, voted }) => {
3131
<IconButton
3232
src={voted ? ThumbUpFilled : ThumbUpOutline}
3333
onClick={handleClick}
34-
className="post-footer-icon-dimentions"
34+
className="post-footer-icon-dimensions"
3535
alt="Like"
3636
iconAs={Icon}
37-
iconClassNames="like-icon-dimentions"
37+
iconClassNames="like-icon-dimensions"
3838
/>
3939
</OverlayTrigger>
4040
<div className="font-style">

0 commit comments

Comments
 (0)