A React web application which provides the front-end user interface for the online discovery of archival collections, objects, and agents at the Rockefeller Archive Center.
DIMES is part of Project Electron, an initiative to build sustainable, open and user-centered infrastructure for the archival management of digital records at the Rockefeller Archive Center.
Install git and clone the repository
$ git clone https://github.com/RockefellerArchiveCenter/dimes.git
Install dependencies and run the development server:
$ yarn install
$ yarn start
The repository includes BackstopJS to test visual changes to the site by comparing a set of reference images for different screen sizes. Anytime the CSS styles are changed, use BackstopJS to test locally:
- Run the development server:
yarn start
- Run Docker.
- In another terminal, run the BackstopJS tests:
yarn backstop-test
. - Review the results in the browser and look at the diff of any failed tests.
- To update the reference image files with the results of the last test images use:
yarn backstop-approve
. Subsequent tests will be compared against these updated reference files. - Commit any updated reference images to the repository so that future tests will be compared against the most recent images.
To add or update reference images, edit the scenarios in backstop.json
and run yarn backstop-reference
.
The repository includes linguijs which is an Open-source Internationalization Framework. This allows you to translate static UI elements into other languages.
DIMES is currently translated into the following languages:
- Chinese (Simplified)
- French
- German
- Italian
- Japanese
- Korean
- Portuguese (Brazilian)
- Spanish
- Turkish
Lingui requires a configuration file (located in the base directory and named lingui.config.js
). See the official documentation for full instructions on configuration.
DIMES uses a macro implementation for message extraction. This means that all text with a <Trans></Trans>
block will be automatically extracted for localization files.
- If adding a new language translation, add a new directory named after the language's ISO 639-1 code to
/src/locales/
. Then add that ISO 639-1 code to thelocales
array inlingui.config.js
. - Run
$ yarn lingui-extract
to extract translation strings from application code. This command will automatically generate amessages.po
file in the language's/src/locales/
directory. - Add translations to each
msgstr
line in the createdmessages.po
. - Run
$ yarn lingui-compile
to compile the locale files into Javascript files which are used by the application to present translated strings. This command should be run whenever changes are made to any of the locale files. - Commit updated code to the GitHub repository.
- If adding a new HTML element for translation, first make sure that the HTML file includes
import { Trans } from "@lingui/ macro";
. - Wrap the desired string to transform in the
<Trans>
macro if adding a new element, or update the HTML structure within an already existing<Trans>
tag. - Run
$ yarn lingui-extract
to add or update any translation strings from the updated HTML structure. Failure to run this will result in translated strings being presented as random numbers and letters in the built application. This command's output will also show any translation items without translations. If you have removed translation strings you may want to runyarn lingui-extract --clean
which will remove any missing strings from themessages.po
file. - Update or add
msgstr
lines in allmessages.po
files based on the changes. - Run
$ yarn lingui-compile
to update the locale files into Javascript files which are used by the application to present translated strings. - Commit updated code to the GitHub repository.
- Open the desired
messages.po
file in the desired language's/src/locales/
directory. - Find and update the desired
msgstr
translation. - Save the updated
messages.po
file. - Run
$ yarn lingui-compile
to update the locale files into Javascript files which are used by the application to present translated strings. - Commit updated code to the GitHub repository.
Available dates for reading rooms can be pulled from Aeon via the request broker by setting the REACT_APP_ENABLE_READING_ROOM_SELECT
environment variable. Not setting this environment variable or leaving it blank will disable this feature. Setting this environment variable to any string will activate it.
It is possible to limit the number of duplication requests a user can submit at once by setting the REACT_APP_DUPLICATION_REQUEST_LIMIT
environment variable. Not setting this environment variable or leaving it blank will disable this feature.
This code is released under an MIT License.