fix: double encoded translations need to be parsed

pull/274/head
Sebastien Marinier 2024-05-16 19:42:10 +02:00
parent 5935c093dd
commit c89653e5bf
3 changed files with 9 additions and 3 deletions

View File

@ -45,6 +45,7 @@
"colors": "^1.4.0", "colors": "^1.4.0",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"execa": "^6.1.0", "execa": "^6.1.0",
"html-react-parser": "^5.1.10",
"libxmljs": "^0.19.8", "libxmljs": "^0.19.8",
"qrcode.react": "^2.0.0", "qrcode.react": "^2.0.0",
"react-copy-to-clipboard": "^5.0.2", "react-copy-to-clipboard": "^5.0.2",

View File

@ -1,3 +1,4 @@
import parse from 'html-react-parser';
import { Access } from './Api'; import { Access } from './Api';
export const AccessOptions = { export const AccessOptions = {
@ -8,3 +9,7 @@ export const AccessOptions = {
[Access.Internal]: t('bbb', 'Internal'), [Access.Internal]: t('bbb', 'Internal'),
[Access.InternalRestricted]: t('bbb', 'Internal restricted'), [Access.InternalRestricted]: t('bbb', 'Internal restricted'),
}; };
export function t_raw(app: string, string: string, vars?: { [key: string]: string }, count?: number, options?: EscapeOptions){
return parse(t(app, string, vars, count, options));
}

View File

@ -5,14 +5,14 @@ import { Access, Room, Permission, RoomShare, api, Restriction } from '../Common
import Dialog from './Dialog'; import Dialog from './Dialog';
import ShareWith from './ShareWith'; import ShareWith from './ShareWith';
import { SubmitInput } from './SubmitInput'; import { SubmitInput } from './SubmitInput';
import { AccessOptions } from '../Common/Translation'; import { AccessOptions, t_raw} from '../Common/Translation';
const descriptions: { [key: string]: string } = { const descriptions: { [key: string]: string } = {
name: t('bbb', 'Descriptive name of this room.'), name: t('bbb', 'Descriptive name of this room.'),
welcome: t('bbb', 'This message is shown to all users in the chat area after they joined.'), welcome: t('bbb', 'This message is shown to all users in the chat area after they joined.'),
maxParticipants: t('bbb', 'Sets a limit on the number of participants for this room. Zero means there is no limit.'), maxParticipants: t('bbb', 'Sets a limit on the number of participants for this room. Zero means there is no limit.'),
recording: t('bbb', 'If enabled, the moderator is able to start the recording.'), recording: t('bbb', 'If enabled, the moderator is able to start the recording.'),
access: t('bbb', 'Explanation of the different concepts that constitute access options :<br>- Public: Anyone who has the link can join.- <br>Internal: Only Nextcloud users can join.- <br>Password: Only guests who have the password can join..- <br>Waiting room: A moderator must accept each guest before they can join.- <br>Restricted : Only selected users and groups can access this room.'), access: t_raw('bbb', 'Explanation of the different concepts that constitute access options :<br> - Public: Anyone who has the link can join.<br> - Internal: Only Nextcloud users can join.<br> - Password: Only guests who have the password can join..<br>- Waiting room: A moderator must accept each guest before they can join.<br> - Restricted : Only selected users and groups can access this room.'),
moderator: t('bbb', 'A moderator is able to manage all participants in a meeting including kicking, muting or selecting a presenter. Users with the role moderator are also able to close a meeting or change the default settings.'), moderator: t('bbb', 'A moderator is able to manage all participants in a meeting including kicking, muting or selecting a presenter. Users with the role moderator are also able to close a meeting or change the default settings.'),
requireModerator: t('bbb', 'If enabled, normal users have to wait until a moderator is in the room.'), requireModerator: t('bbb', 'If enabled, normal users have to wait until a moderator is in the room.'),
moderatorToken: t('bbb', 'If enabled, a moderator URL is generated which allows access with moderator permission.'), moderatorToken: t('bbb', 'If enabled, a moderator URL is generated which allows access with moderator permission.'),
@ -103,7 +103,7 @@ const EditRoomDialog: React.FC<Props> = ({ room, restriction, updateProperty, op
} }
return ( return (
<Dialog open={open} onClose={() => setOpen(false)} title={t('bbb', 'Edit "{room}"', { room: room.name })}> <Dialog open={open} onClose={() => setOpen(false)} title={t_raw('bbb', 'Edit "{room}"', { room: room.name })}>
<div className="bbb-form-element"> <div className="bbb-form-element">
<h3>{t('bbb', 'Room URL')}</h3> <h3>{t('bbb', 'Room URL')}</h3>
<div className="bbb-input-container"> <div className="bbb-input-container">