Custom translation support: Is it possible?

Custom translation support: Is it possible?
0

#1

Hello,

I wanted to start working on a Turkish translation for a while and unfortunately I’ve just read “…we are focused to have translations only in the 5 additional languages as you see on the contributing doc…because of the operational logistics…”

I was wondering if it’s possible to add a feature giving user an option to use some custom external JSON API source to fetch translated version of challenge/guide data.

Rationale:

  • Languages other than officially supported five can be maintained by their respective community with minimum operational overhead to FCC staff.
  • When/if a language is to be officially supported, base translations would be ready.
  • FCC will be accessible to more people. I admire FCC as a social project. It enables people in difficult situations from different professions to change their career path. In the specific case of Turkish translation, there are thousands of people dismissed from their jobs in Turkey currently, who aren’t allowed to leave country either Their situation gets even worse as the time passes. In my online discussion with some of those people, they were willing to self-study to switch their career so that they can work freelance, however resources in Turkish language is a bit limited. So, that’s my personal answer for “why the hurry?” question.

My initial thought was creating a gatsby repository to store markdown files and building static json files on there automatically with each commit (probably on Github Pages/Surge etc.). However, I’m not sure how to glue these to FCC site. I considered using Tampermonkey to hack around, yet I realized it would require too many hacks and wouldn’t function reliably still.

I went through FCC codebase and gatsby docs&tutorials. I decided accomplishing this all by myself is over my head as I don’t have much experience with most frameworks used in FCC development. TBH, I’m not sure if this is an applicable idea either.

What do you think? Is this feasible? If it is so, I can try implementing necessary parts given somebody point me in the right direction.

Thanks.


#2

My understanding is that the plan is to keep increasing the number of languages. There’s a lot of overhead that goes into adding another supported language and there are still hundreds of translation PRs from the initial 5 languages that need to be reviewed. In order to keep the quality of FCC for all languages, they need to roll out new languages in phases.


#3

I agree with your understanding, but I’m not suggesting adding more languages to be officially maintained under FCC project. I’m suggesting adding an endpoint to FCC project allowing users to opt for using external translation projects as data source, which will be maintained by their respective community, not by FCC staff, i.e. not maintained under github.com/freeCodeCamp/freeCodeCamp.

Let me give a straw example: Volunteers will maintain a separate repo for unofficial translations (e.g. github.com/ozars/fcc-unofficial-tr). It will be a gatsby project using the same data layout with FCC (i.e. challenge/guide markdown files), but it will produce static json output files corresponding to markdown files.

From what I understood looking at the FCC codebase, this is how things work in FCC website currently:
(1) User accesses to learn page to solve a challenge.
(2) Static challenge page layout is loaded. Challenge specific data is requested from FCC server.
(3) gatsby source plugin provides data corresponding to GraphQL query for learn page either by fetching related mongodb entries or by transforming related markdown files (not sure which one is used). Language of the challenge depends on the data provided in this step.

In my understanding, there needs to be an addition in third step to allow custom repository:
(3) FCC server checks if user opted in for an external repository URL (user can configure this from the settings page).

  • If user opted in for a custom repo, server will respond with this URL. From that point necessary ajax requests will be made to custom repo (e.g. raw.githubusercontent.com/ozars/fcc-unofficial-tr/…) in the client side. Structure of json responses should match with the structure of GraphQL query.
  • Else, it will be pretty much same behavior with the current one.

Three requirements for implementing this:

  • A gatsby source plugin to request and parse JSON documents on the client side.
  • A gatsby transform plugin to decide on which source to use.
  • Updating GraphQL queries to use above transform plugin.

These are based on my understanding of FCC codebase and how gatsby works. If these are accurate && FCC staff approves such a feature, I can start working on those plugins in a separate repository to integrate them with FCC later.

Does it make sense or sound like too much fantasy? :slight_smile: