Skip to content

Commit

Permalink
feat(language) add lang option
Browse files Browse the repository at this point in the history
  • Loading branch information
mihhu committed Oct 13, 2023
1 parent b5aa389 commit 321e5e3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ Optional. Information regarding the devices used during the call.
###### `userInfo`
Optional. Details about the participant that started the meeting.

###### `lang`
Optional. The default meeting language.

###### `release`
Optional. Information regarding the `stage.8x8.vc` or `8x8.vc` release version. Expects the following format: `release-1234`.

Expand Down
1 change: 1 addition & 0 deletions example/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const App = () => {
subject: 'lalalala',
hideConferenceSubject: false
}}
lang = 'de'
onApiReady = { externalApi => handleApiReady(externalApi) }
onReadyToClose = { handleReadyToClose }
getIFrameRef = { handleJitsiIFrameRef1 } />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jitsi/react-sdk",
"version": "1.3.0",
"version": "1.4.0",
"description": "React SDK for the Jitsi Meet IFrame",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/JaaSMeeting.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ describe('JaaSMeeting component', () => {
appId: 'testAppId',
onApiReady: (externalApi: IJitsiMeetExternalApi) => {
console.log(externalApi);
}
},
lang: 'es'
};
const wrapper = shallow(<JaaSMeeting {...props} />);

expect(wrapper.find(JitsiMeeting).prop('roomName')).toBe('testAppId/TestingJaaSMeetingProps-prod');
expect(wrapper.find(JitsiMeeting).prop('domain')).toBe('8x8.vc');
expect(wrapper.find(JitsiMeeting).prop('lang')).toBe('es');
});

it('should pass the correct props to the JitsiMeeting component (stage)', () => {
Expand Down
6 changes: 5 additions & 1 deletion src/components/JitsiMeeting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const JitsiMeeting = ({
devices,
userInfo,
release,
lang,
spinner: Spinner,
onApiReady,
onReadyToClose,
Expand Down Expand Up @@ -71,6 +72,7 @@ const JitsiMeeting = ({
devices,
userInfo,
release,
lang,
parentNode: meetingRef.current
});
setLoading(false);
Expand All @@ -96,7 +98,9 @@ const JitsiMeeting = ({
jwt,
invitees,
devices,
userInfo
userInfo,
release,
lang
]);

useEffect(() => {
Expand Down
5 changes: 5 additions & 0 deletions src/types/IMeetingProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export default interface IMeetingProps {
email: string;
};

/**
* The default meeting language.
*/
lang?: string;

/**
* The `stage.8x8.vc` or `8x8.vc` release version to test.
* Expects the following format: `release-1234`.
Expand Down
5 changes: 5 additions & 0 deletions src/types/JitsiMeetExternalApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export type JitsiMeetExternalApi = {
email: string
},

/**
* The default meeting language.
*/
lang?: string,

/**
* The `stage.8x8.vc` or `8x8.vc` release version to test.
* Expects the following format: `release-1234`.
Expand Down

0 comments on commit 321e5e3

Please sign in to comment.