Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to English translations in e2e tests #697

Merged
merged 3 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion e2e/helpers/language.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import assign from 'lodash/assign';

import * as english from '../../app/locales/en.json';
import * as haitian from '../../app/locales/ht.json';

/**
* Language strings for each locale. Strings are merged with english as a base
* to emulate i18next's english fallback in the case of missing locale strings.
*/
const languageStrings = {
'en-US': english,
'ht-HT': haitian,
'ht-HT': assign({}, english, haitian),
};

export const languages = Object.keys(languageStrings).map(locale => [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"emotion-theming": "^10.0.27",
"i18next": "^19.3.3",
"js-yaml": "^3.13.1",
"lodash": "^4.17.15",
tstirrat marked this conversation as resolved.
Show resolved Hide resolved
"patch-package": "^6.2.2",
"pluralize": "^8.0.0",
"postinstall-postinstall": "^2.0.0",
Expand Down