-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from RockefellerArchiveCenter/development
Supports translation of interface via lingui
- Loading branch information
Showing
93 changed files
with
3,653 additions
and
966 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @type {import('@lingui/conf').LinguiConfig} */ | ||
module.exports = { | ||
locales: ["en"], | ||
sourceLocale: "en", | ||
catalogs: [{ | ||
path: "src/locales/{locale}/messages", | ||
include: ["src"], | ||
exclude: ["**/node_modules/**", "src/styles/**", "src/locales**"] | ||
}], | ||
format: "po" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/components/AgentAttribute/__tests__/AgentAttribute.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { I18nApp } from '../../i18n' | ||
import AgentAttributeList from '..' | ||
|
||
const items = {'Positions Held': 'foo', 'Date of Birth': 'bar', 'Date of Dath': 'baz'} | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
render(<AgentAttributeList items={items} />, div) | ||
render(<I18nApp ReactComponent={<AgentAttributeList items={items} />} />, div) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { act } from 'react-dom/test-utils' | ||
import { I18nApp } from '../../i18n' | ||
import { Badge } from '..' | ||
|
||
it('renders without errors', () => { | ||
const div = document.createElement('div') | ||
document.body.appendChild(div) | ||
|
||
act(() => { | ||
render(<Badge text={"foobar"} />, div) | ||
render(<I18nApp ReactComponent={<Badge text={"foobar"} />} />, div) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 14 additions & 6 deletions
20
src/components/ContextSwitcher/__tests__/ContextSwitcher.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { act } from 'react-dom/test-utils' | ||
import { I18nApp } from '../../i18n' | ||
import { t } from '@lingui/macro' | ||
import ContextSwitcher from '..' | ||
|
||
it('renders props correctly', () => { | ||
const div = document.createElement('div') | ||
document.body.appendChild(div) | ||
|
||
act(() => { | ||
render(<ContextSwitcher | ||
render(<I18nApp ReactComponent={<ContextSwitcher | ||
isContentShown={false} | ||
toggleIsContentShown={jest.fn()} />, div) | ||
toggleIsContentShown={jest.fn()} />} />, div) | ||
}) | ||
|
||
const switcher = document.querySelector('.toggle-wrapper > button') | ||
expect(switcher.className).toBe('btn toggle-context') | ||
expect(switcher.textContent).toContain('Collection Content') | ||
expect(switcher.textContent).toContain(t({ | ||
comment: 'switcher label text content', | ||
message: 'Collection Content' | ||
})) | ||
|
||
act(() => { | ||
render(<ContextSwitcher | ||
render(<I18nApp ReactComponent={<ContextSwitcher | ||
isContentShown | ||
toggleIsContentShown={jest.fn()} />, div) | ||
toggleIsContentShown={jest.fn()} />} />, div) | ||
}) | ||
|
||
expect(switcher.className).toBe('btn toggle-context') | ||
expect(switcher.textContent).toContain('Collection Details') | ||
expect(switcher.textContent).toContain(t({ | ||
comment: 'switcher label text content', | ||
message: 'Collection Details' | ||
})) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.