Compare commits

...

1 Commits

Author SHA1 Message Date
David Joy
f46db1f1d4 Updating i18n-loader with all our languages. 2019-05-07 09:08:33 -04:00
10 changed files with 165 additions and 4 deletions

View File

@@ -20,17 +20,50 @@ import enLocale from 'react-intl/locale-data/en';
import es419Locale from 'react-intl/locale-data/es';
import frLocale from 'react-intl/locale-data/fr';
import zhcnLocale from 'react-intl/locale-data/zh';
import caLocale from 'react-intl/locale-data/ca';
import heLocale from 'react-intl/locale-data/he';
import idLocale from 'react-intl/locale-data/id';
import kokrLocale from 'react-intl/locale-data/ko';
import plLocale from 'react-intl/locale-data/pl';
import ptbrLocale from 'react-intl/locale-data/pt';
import ruLocale from 'react-intl/locale-data/ru';
import thLocale from 'react-intl/locale-data/th';
import ukLocale from 'react-intl/locale-data/uk';
import COUNTRIES, { langs as countryLangs } from 'i18n-iso-countries';
import LANGUAGES, { langs as languageLangs } from '@cospired/i18n-iso-languages';
import arMessages from './messages/ar.json';
import caMessages from './messages/ca.json';
// no need to import en messages-- they are in the defaultMessage field
import es419Messages from './messages/es_419.json';
import frMessages from './messages/fr.json';
import zhcnMessages from './messages/zh_CN.json';
import heMessages from './messages/he.json';
import idMessages from './messages/id.json';
import kokrMessages from './messages/ko_kr.json';
import plMessages from './messages/pl.json';
import ptbrMessages from './messages/pt_br.json';
import ruMessages from './messages/ru.json';
import thMessages from './messages/th.json';
import ukMessages from './messages/uk.json';
addLocaleData([...arLocale, ...enLocale, ...es419Locale, ...frLocale, ...zhcnLocale]);
addLocaleData([
...arLocale,
...enLocale,
...es419Locale,
...frLocale,
...zhcnLocale,
...caLocale,
...heLocale,
...idLocale,
...kokrLocale,
...plLocale,
...ptbrLocale,
...ruLocale,
...thLocale,
...ukLocale,
]);
// TODO: When we start dynamically loading translations only for the current locale, change this.
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/ar.json'));
@@ -38,20 +71,49 @@ COUNTRIES.registerLocale(require('i18n-iso-countries/langs/en.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/es.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/fr.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/zh.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/ca.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/he.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/id.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/ko.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/pl.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/pt.json'));
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/ru.json'));
// COUNTRIES.registerLocale(require('i18n-iso-countries/langs/th.json')); // Doesn't exist in lib.
COUNTRIES.registerLocale(require('i18n-iso-countries/langs/uk.json'));
// TODO: When we start dynamically loading translations only for the current locale, change this.
// TODO: Also note that Arabic (ar) and Chinese (zh) are missing here. That's because they're
// not implemented in this library. If you read this and it's been a while, go check and see
// if that's changed!
// TODO: Also note that a bunch of languages are missing here. They're present but commented out
// for reference. That's because they're not implemented in this library. If you read this and it's
// been a while, go check and see if that's changed!
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/ar.json'));
LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/en.json'));
LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/es.json'));
LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/fr.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/zh.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/ca.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/he.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/id.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/ko.json'));
LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/pl.json'));
LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/pt.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/ru.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/th.json'));
// LANGUAGES.registerLocale(require('@cospired/i18n-iso-languages/langs/uk.json'));
const messages = { // current fallback strategy is to use the first two letters of the locale code
ar: arMessages,
es: es419Messages,
fr: frMessages,
zh: zhcnMessages,
ca: caMessages,
he: heMessages,
id: idMessages,
ko: kokrMessages,
pl: plMessages,
pt: ptbrMessages,
ru: ruMessages,
th: thMessages,
uk: ukMessages,
};
const cookies = new Cookies();

11
src/i18n/messages/ca.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/he.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/id.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/pl.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/ru.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/th.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}

11
src/i18n/messages/uk.json Normal file
View File

@@ -0,0 +1,11 @@
{
"siteheader.links.courses": "Courses",
"siteheader.links.programs": "Programs & Degrees",
"siteheader.links.schools": "Schools & Partners",
"siteheader.user.menu.dashboard": "Dashboard",
"siteheader.user.menu.profile": "Profile",
"siteheader.user.menu.account.settings": "Account",
"siteheader.user.menu.logout": "Logout",
"siteheader.user.menu.login": "Login",
"siteheader.user.menu.register": "Sign Up"
}