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

fix: Added translation for room visibility dropdown #6786

Merged
merged 4 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,10 @@ export default {
social: 'social',
selectAWorkspace: 'Select a workspace',
growlMessageOnError: 'Unable to create policy room, please check your connection and try again.',
visibilityOptions: {
restricted: 'Restricted',
private: 'Private',
},
},
keyboardShortcutModal: {
title: 'Keyboard Shortcuts',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,10 @@ export default {
social: 'social',
selectAWorkspace: 'Seleccionar un espacio de trabajo',
growlMessageOnError: 'No ha sido posible crear el espacio de trabajo, por favor comprueba tu conexión e inténtalo de nuevo.',
visibilityOptions: {
restricted: 'Restringido',
private: 'Privado',
},
},
keyboardShortcutModal: {
title: 'Atajos de teclado',
Expand Down
11 changes: 7 additions & 4 deletions src/pages/workspace/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ class WorkspaceNewRoomPage extends React.Component {
return null;
}
const shouldDisableSubmit = Boolean(!this.state.roomName || !this.state.policyID || this.state.error);

const visibilityOptions = _.map(_.values(CONST.REPORT.VISIBILITY), v => ({
Copy link
Member

@parasharrajat parasharrajat Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use a more descriptive name instead of v?

label: this.props.translate(`newRoomPage.visibilityOptions.${v}`),
value: v,
}));

return (
<ScreenWrapper>
<HeaderWithCloseButton
Expand Down Expand Up @@ -157,10 +163,7 @@ class WorkspaceNewRoomPage extends React.Component {
<ExpensiPicker
value={CONST.REPORT.VISIBILITY.RESTRICTED}
label={this.props.translate('newRoomPage.visibility')}
items={[
{label: 'Restricted', value: CONST.REPORT.VISIBILITY.RESTRICTED},
{label: 'Private', value: CONST.REPORT.VISIBILITY.PRIVATE},
]}
items={visibilityOptions}
onChange={visibility => this.setState({visibility})}
/>
</View>
Expand Down