frontend-app-learning icon indicating copy to clipboard operation
frontend-app-learning copied to clipboard

Incorrect id for a message

Open sambapete opened this issue 2 years ago • 5 comments

Because one of our users complained of a wrong translation, I found something that may be confusing.

In src/alerts/course-start-alert/CourseStartAlert.jsx shouldn't id="learning.outline.alert.end.long" really be id="learning.outline.alert.start.long" ?

sambapete avatar Mar 18 '23 02:03 sambapete

@sambapete can you be more specific about which translation was incorrect?

Note: There is no learning.outline.alert.start.long, but there is a learning.outline.alert.start.short.

rediris avatar Aug 22 '23 17:08 rediris

That's the problem. In the code, in src/alerts/course-start-alert/CourseStartAlert.jsx, learning.outline.alert.end.long should really be learning.outline.alert.start.long

Line 71 should be learning.outline.alert.start.long instead of learning.outline.alert.end.long. Look at the code, it does not make sense that it would be end.long.

sambapete avatar Aug 22 '23 18:08 sambapete

Hi @sambapete I was trying to point out that none of the translation json files reference that variable name. For example, see https://github.com/openedx/frontend-app-learning/blob/master/src/i18n/messages/de.json#L9-L10 Check some of the other translation files too. There is a learning.outline.alert.start.short but there is no learning.outline.alert.start.long, so you might consider updating your PR to reflect that. https://github.com/openedx/frontend-app-learning/pull/1167

rediris avatar Aug 24 '23 13:08 rediris

Exactly. That's because the id used on line 71 is "wrong". As I said it should be learning.outline.alert.start.long and it does not exist. And if you modify the code, the harvest of strings for Transifex will pick up the new id and add it to the translation files. We're basically saying the same thing.

sambapete avatar Aug 24 '23 14:08 sambapete

@sambapete Ah, gotcha. Thanks for clarifying!

rediris avatar Aug 24 '23 14:08 rediris

This was fixed by https://github.com/openedx/frontend-app-learning/pull/1173

bradenmacdonald avatar Sep 12 '24 22:09 bradenmacdonald