-
-
Notifications
You must be signed in to change notification settings - Fork 476
Add en.json generator #803
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
Conversation
The getenJSON script generates the en.json file from the data.json file and the enJSONStaticStrings.json file.
English version of the Reference JSON files.
File containing the static strings of the Reference section that have to be inserted at the beginning of the en.json file.
Change the swapping of the text that has to translated, in order to match the new structure of the Reference JSON file.
Add script section that performs the text swaps in "class" pages of the Reference.
Can the two JSON files be combined into one? Just to make the process of copying it to create a new language more straightforward. |
@limzykenneth I think I explained the enJSONStaticStrings.json file poorly. I split the en.json into three main sections:
While the module names and the documentation are extracted from the data.json, the static strings can't be, so I stored them in the enJSONStaticStrings.json to have a place to fetch them when the getenJSON script builds the en.json. So, in short, the enJSONStaticStrings.json is only needed for building the en.json, which is the only file that will have to be copied when starting a new translation. |
I see, in that case can the data in If I understand correctly the workflow is generate |
I originally included the strings in the getenJSON.js script, but changed it after discussing it with Evelyn. We both agreed it would be cleaner this way. I didn't consider the fact that it could be confusing, to be honest. @outofambit what do you think? |
I guess one of the main reason I find it potentially confusing is because of the name |
I see, maybe just |
|
@yukienomiya this is looking great! It seems like there are a few details in your description and the conversation here that are not yet captured in the i18n_contribution.md file yet. I wonder if the "How the website works" section could be updated a bit to include this? Or if this feels too in-depth for this particular section, maybe just a "Notes" section at the end of this page could be useful? |
I'm closing this PR because I'm splitting it into two new ones, in order to separate the JSON structure change from the getenJSON script. |
Changes:
This file could serve both as a template for new translations and as an always up-to-date model to compare the translations with, in order to know when and where they need to be updated.
Structure of the en.json file:
Structure changes:
In the original documentation, the description text is split into paragraphs. This is especially important in long descriptions -Classes' for instance- because it helps with the text's legibility.
In the translated JSONs the descriptions were saved as single strings and therefore displayed on the website as single paragraphs.
To fix this, I saved the descriptions as arrays of strings, where each array element represents a paragraph.
The parameter elements are currently saved in arrays of strings, where each element has a "paramType: paramDescription" structure. They are then inserted in the translated webpage in the order in which they were saved. This is problematic because every little edit on the webpage could mess this order up (here for example, the descriptions of the "colorstring" param and the "a" param are switched).
To fix this, I saved the "params" elements as object, where each element has a "paramName": "paramType: paramDescription" structure.