How to fix Portuguese version of Challenge?

I saw an post on the forum about this and an issue on the Github. The code in the hint was translated too and it makes it really hard for campers to solve.

I’m still not familiar with our translation setup entirely and I’m fairly certain we’re not accepting language updates. But this kind of thing seems like it ought to be fixed sooner than later.

I think this may be due to AI translation.

When staff return they’ll be able to sort it out. From what I read, this feature is on a trial basis.

Happy coding

yeah, it’s being tested, anything inside backticks should not be translated, but some seem to escape. Already flagged it internally, it needs to be fixed through the current translation pipeline

I think I wanna try to work on a quick script to try to make sure all the instances of this sort of thing are flagged.

My criteria will be if the text inside of ` ` these single backticks don’t match what is present in the English version of the challenge. And as cool as it would be for it to be some kind of regression test for our platform; it seems a bit unlikely.

Thinking outside the box, should the translated version use the translated version of the word. For instance, for a native Portugeuse Camper using English text to create an app may seem confusing.

If AI technology is to be leveraged, why not allow the technology to make logical decisions.

The tests would also need updating to reflect the wording of the user stories for each language.

  1. Dentro do elemento nav, você deve ter uma lista não ordenada com dois itens contendo links para diferentes seções da página. O primeiro item deve ter o texto Próximos Eventos, e o segundo item deve ter o texto Eventos Passados.
  1. Inside the nav element, you should have an unordered list of two items containing links to different sections of the page. The first item should have the text Upcoming Events, and the second item should have the text Past Events.

I’m not sure if I really trust generative AI to adjust our tests. Especially considering it’s inconsistent and could alter the test logic to where the challenge won’t pass. Like maybe we could use tokens to mark the words we want to display in the file. Like some kind of additional metadata for each step. Then the tokens get translated for each respective language.

Going of this thinking, I was hoping there would be a way to create an sort of an array at the top of the challenge file so that instead of

it’d become

-–

id: 66adc42868cab843ccee87d9

title: Paso 10

challengeType: 1

dashedName: step-10

-–

and become

---
id: 66adc42868cab843ccee87d9
title: Paso 10
challengeType: 1
dashedName: step-10
tokens: ['Eventos Passados']
---

And then somehow would be passed to the test evaluator and be accessible in the challenge tests.

And in the challenge code you would use tokens[0] in place of “Past Events” and in the challenge text it would become some kind of replaced symbol like $1 or whatever that’d be replaced during runtime.

Tokens are one idea.

Since the purpose of backticks are meant to make text untranslatable, and if the idea is to make certain text translatable, how about replacing the backticks of non-code text with quote marks?

This way, for instance, “Próximos Eventos” appears for Portugeuse language Campers, and “Upcoming Event” appears for English language Campers, in the challenge descriptions, user stories, and tests.

I’m not following Teller. My apologies.

But what you said just doesn’t really make any sense to me. I don’t think changing punctuation symbols really will do anything.

This whole issue simplified (to me at least) is a mismatch between the instructions for the test and the code.

My ideal solution is updating the challenge tests to use some sort of external value that I can somewhat trust to be translated by generative artificial intelligence (if FreeCodeCamp is going that route) rather than let it go hog wild on the test code and result in mismatching and potentially broken test code.

I used the word tokens because I don’t know what else to call these values that will be used in both the test code and test text.

we don’t do that because we would need to translate the tests and the seed code, which becomes more unreliable

At the moment, text is translated from English into other languages, with a few exceptions.

The above idea extends that translation from challenge descriptions and user stories to seed code and tests. It may be no more or less reliable than the current setup.

If AI is used, then we may need to accept it will make mistakes, just like people, while ‘machine “learning”’. I understand that reliability is a great concern. However, translation contributors could not keep pace with changes and new material. Even in the legacy sections, many parts of the non-English language challenges are still in English.

Counter idea: When the English language version of a challenge is updated, each of the other languages for that challenge are opened as sub-issues on GitHub. When all languages are translated, then the main issue (English version) and sub-issues are closed.

Is it possible to select one language to A/B test? This could lay the ground work or at least test feasibility. I realise staff are busy rolling out the new curriculum, new languages, and other issues that crop up. Perhaps something to consider for the future?

Tokens, an array of text, seems like a reliable way to insert text into challenge descriptions, user stories, seed code, and tests. Instead of AI translation though, manual translation is used / reused. Or a dictionary of words and terms stored in the repo.

[ freeCodeCamp/client/i18n/locales/portuguese/translations.json at main · freeCodeCamp/freeCodeCamp · GitHub ]

id: 66ebd4ae2812430bb883c787
title: Build an Event Hub
challengeType: 25
dashedName: lab-event-hub
demoType: onClick
token: ['Past Events']
id: 66ebd4ae2812430bb883cxxx
title: Construa um centro de eventos
challengeType: 25
dashedName: lab-event-hub
demoType: onClick
token: ['Past Events']

The token accesses the 'Past Events'token key, in the Portuguese translation JSON file, and obtains the value'Eventos Passados'.

{
  "token": {
    "Past Events": "Eventos Passados",
    "close": "Fechar",
    "edit": "Editar",
    "copy": "Copiar",
    "view": "Visualizar",

A similar file would need to exist for the English language:

{
  "token": {
    "Past Events": "Past Events",
    "close": "Close",
    "edit": "Edit",
    "copy": "Copy",
    "view": "View",

token[0] points to 'Past Events'in the English version.

token[0] points to 'Eventos Passados' in the Portugeuse version.

if you want to propose the translation of the code too, open an issue on github.

We are not going to block English curriculum to wait for the other languages, it would really slow down the release of content or bug fixes.

that’s why we are trying the automated translations

1 Like

Looks like an issue was raised on GitHub.

I think give time to trial automated translations.