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 all commits
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
13 changes: 9 additions & 4 deletions e2e/helpers/language.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import merge from 'lodash/merge';

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

Expand All @@ -6,7 +8,10 @@ const languageStrings = {
'ht-HT': haitian,
};

export const languages = Object.keys(languageStrings).map(locale => [
locale,
languageStrings[locale],
]);
export const languages = Object.entries(languageStrings).map(
([locale, strings]) => [
locale,
// fall back to english if not found in the locale strings
merge({}, english, strings),
],
);
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