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

feat: remove Transifex calls for OEP-58 for for header #620

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ LOGO_WHITE_URL=https://edx-cdn.org/v3/prod/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/prod/favicon.ico
NOTIFICATION_FEEDBACK_URL=''
CAREERS_URL=''
STUDIO_BASE_URL=''
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ LOGO_WHITE_URL=https://edx-cdn.org/v3/prod/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/prod/favicon.ico
NOTIFICATION_FEEDBACK_URL=''
CAREERS_URL=''
STUDIO_BASE_URL=''
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export TRANSIFEX_RESOURCE = frontend-component-header-edx
transifex_resource = frontend-component-header-edx
transifex_langs = "ar,fr,es_419,zh_CN,pt,it,de,uk,ru,hi,fr_CA"

intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json
Expand Down Expand Up @@ -50,9 +47,16 @@ push_translations:
# Pushing comments to Transifex...
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh

# Pulls translations from Transifex.
pull_translations:
tx pull -t -f --mode reviewed --languages=$(transifex_langs)
rm -rf src/i18n/messages
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-component-header/src/i18n/messages:frontend-component-header\
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/paragon/src/i18n/messages:paragon \

$(intl_imports) frontend-component-header-edx frontend-platform paragon

# This target is used by Travis.
validate-no-uncommitted-package-lock-changes:
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@edx/browserslist-config": "1.2.0",
"@edx/frontend-platform": "^8.1.0",
"@edx/reactifex": "2.2.0",
"@edx/openedx-atlas": "^0.6.0",
"@openedx/frontend-build": "^14.0.10",
"@testing-library/dom": "9.3.4",
"@testing-library/jest-dom": "5.17.0",
Expand Down
6 changes: 3 additions & 3 deletions src/DesktopHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ DesktopHeader.propTypes = {
items: PropTypes.arrayOf(PropTypes.shape({
type: PropTypes.oneOf(['item', 'menu']),
href: PropTypes.string,
content: PropTypes.string,
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
disabled: PropTypes.bool,
isActive: PropTypes.bool,
onClick: PropTypes.func,
Expand Down Expand Up @@ -255,8 +255,8 @@ DesktopHeader.defaultProps = {
email: '',
loggedIn: false,
notificationAppData: {
apps: { },
tabsCount: { },
apps: {},
tabsCount: {},
appsId: [],
isNewNotificationViewEnabled: false,
notificationExpiryDays: 0,
Expand Down
2 changes: 2 additions & 0 deletions src/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ensureConfig([
'LOGO_URL',
'ACCOUNT_SETTINGS_URL',
'NOTIFICATION_FEEDBACK_URL',
'STUDIO_BASE_URL',
], 'Header component');

subscribe(APP_CONFIG_INITIALIZED, () => {
Expand Down Expand Up @@ -188,6 +189,7 @@ const Header = ({
secondaryMenu: getConfig().MINIMAL_HEADER || getConfig().AUTHN_MINIMAL_HEADER ? [] : secondaryMenu,
userMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : userMenu,
loggedOutItems: getConfig().AUTHN_MINIMAL_HEADER ? [] : loggedOutItems,
studioBaseUrl: config.STUDIO_BASE_URL,
};

if (enterpriseCustomerBrandingConfig) {
Expand Down
10 changes: 9 additions & 1 deletion src/Notification/data/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ export function useNotification() {
isNewNotificationViewEnabled,
};
} catch (error) {
return { notificationStatus: RequestStatus.FAILED };
return {
notificationStatus: RequestStatus.FAILED,
apps: {},
appsId: [],
isNewNotificationViewEnabled: false,
notificationExpiryDays: 0,
showNotificationsTray: false,
tabsCount: { count: 0 },
};
}
}, [normalizeNotificationCounts]);

Expand Down
4 changes: 2 additions & 2 deletions src/Notification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ Notifications.propTypes = {
Notifications.defaultProps = {
showLeftMargin: true,
notificationAppData: {
apps: { },
tabsCount: { },
apps: {},
appsId: [],
isNewNotificationViewEnabled: false,
notificationExpiryDays: 0,
notificationStatus: '',
showNotificationsTray: false,
tabsCount: { count: 0 },
},
};

Expand Down
38 changes: 12 additions & 26 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import arMessages from './messages/ar.json';
import frMessages from './messages/fr.json';
import es419Messages from './messages/es_419.json';
import zhcnMessages from './messages/zh_CN.json';
import ptMessages from './messages/pt.json';
import itMessages from './messages/it.json';
import ukMessages from './messages/uk.json';
import deMessages from './messages/de.json';
import ruMessages from './messages/ru.json';
import hiMessages from './messages/hi.json';
import frCAMessages from './messages/fr_CA.json';
// no need to import en messages-- they are in the defaultMessage field
// This file is generated by the openedx/frontend-platform's "intl-import.js" script.
//
// Refer to the i18n documents in https://docs.openedx.org/en/latest/developers/references/i18n.html to update
// the file and use the Micro-frontend i18n pattern in new repositories.
//

const messages = {
ar: arMessages,
'es-419': es419Messages,
fr: frMessages,
'zh-cn': zhcnMessages,
pt: ptMessages,
it: itMessages,
de: deMessages,
hi: hiMessages,
'fr-ca': frCAMessages,
ru: ruMessages,
uk: ukMessages,
};
// Skipped import due to missing 'frontend-component-header-edx/index.js' likely due to empty translations..
import messagesFromFrontendPlatform from './messages/frontend-platform';
import messagesFromParagon from './messages/paragon';

export default messages;
export default [
messagesFromFrontendPlatform,
messagesFromParagon,
];
53 changes: 0 additions & 53 deletions src/i18n/messages/de.json

This file was deleted.

53 changes: 0 additions & 53 deletions src/i18n/messages/fr.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,34 @@
"header.links.programs": "البرامج",
"header.links.content.search": "اكتشف الجديد",
"header.links.schools": "المدارس و الشركاء",
"header.user.menu.career": "حياة مهنية",
"header.user.menu.newAlert": "جديد",
"header.user.menu.dashboard": "لوحة المعلومات",
"header.user.menu.profile": "الملف الشخصي",
"header.user.menu.account.settings": "الحساب",
"header.user.menu.order.history": "المشتريات السابقة",
"header.user.menu.order.history": "سجل الطلبيات",
"header.user.menu.logout": "تسجيل الخروج",
"header.user.menu.login": "تسجيل الدخول",
"header.user.menu.register": "التسجيل ",
"header.user.menu.register": "التسجيل",
"header.user.menu.studio.home": "صفحة الاستوديو الرئيسية",
"header.user.menu.studio.maintenance": "الصيانة",
"header.label.account.nav": "الحساب",
"header.label.account.menu": "قائمة الحساب",
"header.label.account.menu.for": "قائمة حساب المستخدم {username}",
"header.label.main.nav": "القائمة الرئيسية",
"header.label.main.nav": "القا|مة الرئيسية",
"header.label.main.menu": "القائمة الرئيسية",
"header.label.main.header": "الرئيسية",
"header.label.secondary.nav": "القائمة الثانوية",
"header.label.skip.nav": "التخطي إلى المحتوى الرئيسي",
"notification.title": "الإشعارات",
"notification.today.heading": "أخر 24 ساعه",
"notification.earlier.heading": "سابقًا",
"notification.mark.as.read": "اشر عليها بانها قرات",
"notification.fullStop": "•",
"notification.load.more.notifications": "تحميل المزيد من الإخطارات",
"notification.feedback": "تقييم",
"notification.recent.all.message": "هذا هو كل الإخطارات الأخيرة الخاصة بك!",
"notification.expired.delete.message": "يتم مسح الإشعارات تلقائيًا بعد أيام {days}",
"notification.no.message": "لا توجد إخطارات حتى الآن",
"notification.no.help.message": "عندما تتلقى إشعارات، ستظهر هنا",
"notification.bell.icon.alt.message": "أيقونة جرس الإشعارات",
"header.label.app.nav": "تطبيق",
"general.register.sentenceCase": "التسجيل",
"general.signIn.sentenceCase": "تسجيل الدخول",
"header.menu.dashboard.label": "لوحة المعلومات",
"header.help.label": "المساعدة",
"header.menu.profile.label": "الملف الشخصي",
"header.menu.account.label": "الحساب",
"header.menu.career.label": "حياة مهنية",
"header.menu.new.label": "جديد",
"header.menu.orderHistory.label": "المشتريات السابقة",
"header.menu.orderHistory.label": "سجل الطلبيات",
"header.navigation.skipNavLink": "التخطي إلى المحتوى الرئيسي",
"header.menu.signOut.label": "تسجيل الخروج",
"header.user.menu.studio": "صفحة الاستوديو الرئيسية",
"header.user.menu.maintenance": "الصيانة",
"header.label.courseOutline": "الرجوع إلى مخطط المساق الكلّي في الاستوديو",
"tour.action.dismiss": "تجاهل",
"tour.action.end": "حسنًا",
"tour.example.title": "جولة المثال",
"tour.example.body": "هذه جولة نموذجية"
"header.label.courseOutline": "الرجوع إلى مخطط المساق الكلّي في الاستوديو"
}
35 changes: 35 additions & 0 deletions src/i18n/messages/frontend-component-header/bo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"header.links.courses": "སློབ་ཚན་ཁག",
"header.links.programs": "ལས་རིམ་ཁག",
"header.links.content.search": "ཞིབ་གཟིགས།",
"header.links.schools": "སློབ་གྲྭ་ཁག་ & མཉམ་འབྲེལ་ཁག",
"header.user.menu.dashboard": "གཙོ་ངོས།",
"header.user.menu.profile": "ངོ་སྤྲོད་སྙིང་བསྡུས།",
"header.user.menu.account.settings": "ཁ་བྱང་།",
"header.user.menu.order.history": "ལོ་རྒྱུས་ཀྱི་གོ་རིམ་སྒྲིག",
"header.user.menu.logout": "ཕྱིར་ཐོན།",
"header.user.menu.login": "ནང་འཛུལ།",
"header.user.menu.register": "ཐོ་འགོད་བྱོས།",
"header.user.menu.studio.home": "སྒྲིག་སྟེགས་གཙོ་ངོས།",
"header.label.account.nav": "ཁ་བྱང་།",
"header.label.account.menu": "ཁ་བྱང་ཐོ་གཞུང་།",
"header.label.account.menu.for": "འདིའི་ {username} ཁ་བྱང་ཐོ་གཞུང་།",
"header.label.main.nav": "གཙོ་བོ།",
"header.label.main.menu": "ཐོ་གཞུང་གཙོ་བོ།",
"header.label.main.header": "གཙོ་བོ།",
"header.label.secondary.nav": "འབྲིང་རིམ།",
"header.label.skip.nav": "ནང་དོན་གཙོ་བོའི་ཐད་ལ་མཆོང་།",
"header.label.app.nav": "མཉེན་ཆས།",
"general.register.sentenceCase": "ཐོ་འགོད།",
"general.signIn.sentenceCase": "ནང་འཛུལ།",
"header.menu.dashboard.label": "གཙོ་ངོས།",
"header.help.label": "རམ་འདེགས།",
"header.menu.profile.label": "ངོ་སྤྲོད་སྙིང་བསྡུས།",
"header.menu.account.label": "ཁ་བྱང་།",
"header.menu.orderHistory.label": "ལོ་རྒྱུས་ཀྱི་གོ་རིམ་སྒྲིག",
"header.navigation.skipNavLink": "ནང་དོན་གཙོ་བོའི་ཐད་ལ་མཆོང་།",
"header.menu.signOut.label": "ཕྱིར་ཐོན།",
"header.user.menu.studio": "སྒྲིག་སྟེགས་གཙོ་ངོས།",
"header.label.courseOutline": "སྒྲིག་སྟེགས་ནང་གི་སློབ་ཚན་གྱི་སྡེ་ཚན་ས་བཅད་ཀྱི་མཚམས་སུ་ཕྱིར་ལོག",
"header.label.search.nav": "ནང་དོན་འཚོལ་བཤེར།"
}
Loading