Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Fixes strings marked for translation. #708

Merged
merged 1 commit into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class RemoveMemberModal extends Component {
this.contentMap = {
[modalModeEnum.leave]: {
headerText: i18next.t("Leave community"),
bodyText: i18next.t("You're about to leave this community."),
bodyText: i18next.t("You are about to leave this community."),
buttonText: i18next.t("Leave"),
},
[modalModeEnum.remove]: {
headerText: i18next.t("Remove user"),
bodyText: i18next.t(
"You're about to remove this user from this community"
"You are about to remove this user from this community."
),
buttonText: i18next.t("Remove"),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export class SelectedMembers extends Component {
>
<Header disabled>
{displayingGroups
? i18next.t("Selected groups.")
: i18next.t("Selected members.")}
? i18next.t("Selected groups")
: i18next.t("Selected members")}
</Header>
</Segment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class GroupTabPane extends Component {
/>
{selectedCount > 0 && (
<Trans key="communityInviteMembersSelected" count={selectedCount}>
You are about to add {{ selectedCount }} groups
You are about to add {{ selectedCount }} groups.
</Trans>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ export const memberVisibilityTypes = [
name: "public",
visible: true,
title: i18next.t("Public"),
description: i18next.t("Your community membership is visible to everyone") + ".",
description: i18next.t("Your community membership is visible to everyone."),
},
{
name: "hidden",
visible: false,
title: i18next.t("Hidden"),
description: i18next.t(
"Your community membership is only visible to other members of the community" + "."
),
"Your community membership is only visible to other members of the community."),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class RenameCommunitySlugButton extends Component {
<Modal.Content>
<Form onSubmit={this.handleChange}>
<Form.Input
label={i18next.t("Enter the new unique identifier of the community")}
label={i18next.t("Enter the new unique identifier of the community.")}
fluid
input={{ ref: this.formInputRef }}
{...(error
Expand Down
2 changes: 1 addition & 1 deletion invenio_communities/communities/services/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def featured_create(self, identity, data=None, record=None, **kwargs):
"""Featured create."""
if record.access.visibility != "public":
raise ValidationError(
_("The community is not public"), field_name="community_id"
_("The community is not public."), field_name="community_id"
)


Expand Down
2 changes: 1 addition & 1 deletion invenio_communities/members/services/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class UpdateBulkSchema(MembersSchema, Schema):
def validate_schema(self, data, **kwargs):
"""Validates that role and/or visible is set."""
if "role" not in data and "visible" not in data:
raise ValidationError(_("Missing fields 'role' and/or 'visible'"))
raise ValidationError(_("Missing fields 'role' and/or 'visible'."))


class DeleteBulkSchema(MembersSchema):
Expand Down
6 changes: 3 additions & 3 deletions invenio_communities/members/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _invite_factory(self, identity, community, role, visible, member, message, u
# add role as message
data = {
"payload": {
"content": _('You will join as "{role}"').format(role=role.title),
"content": _('You will join as "{role}".').format(role=role.title),
}
}
current_events_service.create(
Expand Down Expand Up @@ -488,7 +488,7 @@ def _update(self, identity, community, member, role, visible, uow):
if visible is not None and member.user_id is not None:
if visible and not (is_self or system_identity == identity):
raise ValidationError(
_("You can only set public visibility on your own " "membership."),
_("You can only set public visibility on your own membership."),
)

# Update membership
Expand All @@ -497,7 +497,7 @@ def _update(self, identity, community, member, role, visible, uow):
data = {
"payload": {
"content": _(
'You will join as "{role}" (changed from: "{previous}")'
'You will join as "{role}" (changed from: "{previous}").'
).format(
role=role.title,
previous=member.role,
Expand Down
2 changes: 1 addition & 1 deletion tests/members/test_members_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_invite(client, headers, community_id, owner, new_user_data, db):
assert r.status_code == 200
assert r.json["hits"]["total"] == 2 # role message + invite message
assert (
r.json["hits"]["hits"][0]["payload"]["content"] == 'You will join as "Reader"'
r.json["hits"]["hits"][0]["payload"]["content"] == 'You will join as "Reader".'
)
assert r.json["hits"]["hits"][1]["payload"]["content"] == new_user_data["message"]

Expand Down
2 changes: 1 addition & 1 deletion tests/members/test_members_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_invite_view_request(
).to_dict()
hits = res["hits"]
assert hits["total"] == 2 # role + invitation
assert hits["hits"][0]["payload"]["content"] == 'You will join as "Reader"'
assert hits["hits"][0]["payload"]["content"] == 'You will join as "Reader".'
assert hits["hits"][1]["payload"]["content"] == "Welcome to the club!"


Expand Down