Coder Social home page Coder Social logo

Comments (4)

OmarIthawi avatar OmarIthawi commented on July 18, 2024

Thanks @sambapete and @arbrandes for reporting this issue.

I've checked the file and it's a bug in the messages.js:

import { StrictDict } from 'utils';
export const messages = StrictDict({
upgrade: {
id: 'learner-dash.courseCard.actions.upgrade',
description: 'Course card upgrade button text',
defaultMessage: 'Upgrade',
},
beginCourse: {
id: 'learner-dash.courseCard.actions.beginCourse',
description: 'Course card begin-course button text',

It's using the StrictDict instead of the defineMessage as seen in other files:

import { defineMessages } from '@edx/frontend-platform/i18n';
const messages = defineMessages({
dashboard: {
id: 'learnerVariantDashboard.menu.dashboard.label',
defaultMessage: 'Dashboard',
description: 'The text for the user menu Dashboard navigation link.',
},
dashboardPersonal: {
id: 'learnerVariantDashboard.menu.dashboardPersonal.label',
defaultMessage: 'Personal',

To fix the issue, the CourseCard/components/CourseCardActions/messages.js should be refactored to use defineMessage and it'll make it to transifex shortly (the following day or so).

from frontend-app-learner-dashboard.

sambapete avatar sambapete commented on July 18, 2024

This will fix the problem with CourseCardActions but not all problems.

The same issue exists in other messages.js files in frontend-app-learner-dashboard.

A full review may be needed.

Look at src/containers/SelectSessionModal/messages.js, ./src/containers/CourseCard/components/CourseCardMenu/messages.js and a few others that are also using StrictDict.

And it may be the case in other directories for that MFE and a few other MFEs.

I guess the Translations Working Group and the Frontend Working Group should make sure the translations of MFEs is properly setup for all MFEs. @arbrandes @OmarIthawi

As I am no longer a core contributor to the Open edX project, I don't have the time and I don't know how long it would take me to make a PR to fix all issues, have it reviewed and implemented to fix all the issues with translations in this particular MFE and maybe in other MFEs. Yes, I am passing the ball to the MFEs owners.

I don't know how the community could implement it but a test to make sure that all strings defined in a particular MFE are added to the strings that are sent to Transifex for translations, but I assume this is something that needs to be done now after what we found with frontend-app-communications previously and now with frontend-app-learner-dashboard. My 2 cents.

from frontend-app-learner-dashboard.

ghassanmas avatar ghassanmas commented on July 18, 2024

@sambapete I have made a quick serach across openedx org in github, and it seems this only used learner-dashbaord,
Search link: https://github.com/search?q=org%3Aopenedx+%22export+const+messages+%3D+StrictDict%28%22&type=code

For other MFEs I think the problem we had before that the resources werent synced to TX in the first place.

Regarding a test I agree it would be ideal, so far to my knowledge there are two reason a resource is not TX:( 1. The repo is not synced and 2. The sytanx used to define a message ).

We will discuss this topic in next TWG call CC:@ehuthmacher

from frontend-app-learner-dashboard.

sambapete avatar sambapete commented on July 18, 2024

Thanks @ghassanmas

At least we know it is restricted to this MFE. Since the problem also affects edx.org, maybe it could be given a higher priority to resolve?

Unfortunately, I cannot attend the TWG meetings anymore as we are shutting down our Open edX instance on April 30, 2024. I am no longer a core contributor since we announced it. I found this problem while migrating our courses on edx.org.

from frontend-app-learner-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.