Skip to content

Commit

Permalink
final polish (including translated strings)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Apr 29, 2024
1 parent beedc4b commit 1db1c11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
"wrong_access_code": "Wrong Access Code",
"generate_viewers_access_code": "Generate access code for viewers",
"generate_mods_access_code": "Generate access code for moderators",
"server_tag": "Select a server type for this room",
"server_tag_desired": "Desired",
"server_tag_required": "Required",
"are_you_sure_delete_room": "Are you sure you want to delete this room?"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function RoomSettings() {
currentTag={roomSetting?.data?.serverTag}
tagRequired={roomSetting?.data?.serverTagRequired === 'true'}
allowedTags={currentUser?.allowedTags}
description="Select a specialized server type for this room"
description={t('room.settings.server_tag')}
/>
)}
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// with Greenlight; if not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import { useTranslation } from 'react-i18next';
import PropTypes from 'prop-types';
import {
Row, Col, Dropdown, ButtonGroup, ToggleButton,
Expand All @@ -25,6 +26,7 @@ export default function ServerTagRow({
updateMutation: useUpdateAPI, currentTag, tagRequired, allowedTags, description,
}) {
const updateAPI = useUpdateAPI();
const { t } = useTranslation();

/* eslint-disable no-param-reassign */
const serverTagsMap = process.env.SERVER_TAG_NAMES.split(',').reduce((map, pair) => {
Expand Down Expand Up @@ -63,6 +65,7 @@ export default function ServerTagRow({
<Dropdown.Item
key=""
value={process.env.DEFAULT_TAG_NAME}
disabled={updateAPI.isLoading}
onClick={() => updateAPI.mutate({ settingName: 'serverTag', settingValue: '' })}
>
{process.env.DEFAULT_TAG_NAME}
Expand All @@ -79,11 +82,12 @@ export default function ServerTagRow({
variant="outline-success"
name="radio"
checked={tagRequired === false}
disabled={updateAPI.isLoading}
onChange={() => {
updateAPI.mutate({ settingName: 'serverTagRequired', settingValue: false });
}}
>
Desired
{t('room.settings.server_tag_desired')}
</ToggleButton>
<ToggleButton
key="required"
Expand All @@ -92,11 +96,12 @@ export default function ServerTagRow({
variant="outline-danger"
name="radio"
checked={tagRequired === true}
disabled={updateAPI.isLoading}
onChange={() => {
updateAPI.mutate({ settingName: 'serverTagRequired', settingValue: true });
}}
>
Required
{t('room.settings.server_tag_required')}
</ToggleButton>
</ButtonGroup>
</Col>
Expand Down

0 comments on commit 1db1c11

Please sign in to comment.