Skip to content

Commit

Permalink
feat(i18n): add options field
Browse files Browse the repository at this point in the history
* Add language field in type
  • Loading branch information
mickr committed May 8, 2020
1 parent b45425b commit 2d4fa4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/BoxAnnotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import DocumentAnnotator from './document/DocumentAnnotator';
import { Permissions, PERMISSIONS, Type } from './@types';

type AnnotationsOptions = {
messages?: Record<string, string>;
language?: string;
locale?: string;
messages?: Record<string, string>;
};

type Annotator = {
Expand Down Expand Up @@ -123,7 +124,7 @@ class BoxAnnotations {
return { ...annotator, TYPES: enabledTypes };
}

getAnnotationsOptions(): AnnotationsOptions | undefined {
getOptions(): AnnotationsOptions | undefined {
return this.annotationsOptions;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/BoxAnnotations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ describe('BoxAnnotations', () => {
});
});

describe('getAnnotationsOptions', () => {
describe('getOptions', () => {
it.each([undefined, { messages: { test: 'Hello' } }])(
'should return the passed in options when they are %o',
mockOptions => {
loader = new BoxAnnotations(null, mockOptions);

const options = loader.getAnnotationsOptions();
const options = loader.getOptions();

expect(options).toEqual(mockOptions);
},
Expand Down

0 comments on commit 2d4fa4e

Please sign in to comment.