-
Notifications
You must be signed in to change notification settings - Fork 101
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
[FEAT] Compile all content into one language json file from three separate files #643
Comments
Hi @ngiangre JSON file is updated here: https://github.com/COVID-19-electronic-health-system/Corona-tracker/blob/master/Translations/appText.json |
Extremely detailed @BrianHHough! We can definitely make use of this. |
Seriously!! Awesome work @BrianHHough |
Undid this change - there's a PR process these things need to go through and we can't commit right to master. Don't want to be dictatorial but this can seriously break things. Will need a PR relating to this issue just like everything else. |
Yeah agreed thanks @SomeMoosery. But @salvolpe and I can work with this file if @BrianHHough sends it through discord. @SomeMoosery how can we make a json so that wee can reference tags to update components? |
Yeah no prob! The file looks great, I agree - just need to make sure we're going through the git flow so things don't start to fall off track. I'm also not sure what you mean - what are you trying to update? If you're trying to update components when some value changes that should be done with hooks in the React code. |
Yeah don't want to obstruct the process at all. We need to make sure the text is adequately translated dependent on the locale. We want to try to help you make your hooks with the proper content: I should've first made an issue pertaining to this. @BrianHHough committed to master by accident but it's ok you live and learn. I need to make a more formal issue and description, but I guess this will do. The idea is to allow hooks to be made dependent on the locale chosen (a file with the adequate translation will be pointed to for the correct translation). Sorry I'm not sure how much I can explain here. @SomeMoosery what would be the best way to proceed from here? |
Yeah, so it seems like what can be done from this end is that once we get a master doc for each language merged in, we can create a new issue for which we change the locations specified in i18next to point to these new JSON files, and we should be set 👍 |
Ok great. I made a PR that was approved which put language json files in |
Closing other issues to have this be the issue with all the information. We need to determine the structure of each language's json file, where it should go, and how the content should be referenced for tagging in components to fully integrate our translations and have all available content for the coronatracker app. |
Can we make sure that the privacy policies and terms and conditions are also included as all content? If so, this can be within this issue. |
Yes @tesla809 |
@BrianHHough |
I'm working on it but would love help. The issue is that we need to have the structure in our data model so However we make the keys is consistent, makes sense, and the values can be adapted in the future. Right now only the health sheet follows the data model and has a field name to be included in the tag: We need to fill in the parent/child keys and add a field name for education: And Display Text is incomplete I need help with the data model - I can handle this but @salvolpe can help and anyone else willing to help please reach out. And once the data model is done I can get the content from translations to populate the value via the python script I work a lot with common data models so this is really important. The goal is to allow for creating tags like We need to do this for the education facts in the education gsheet as well as for the display text gsheet. |
@BrianHHough I love your I would suggest modification of the survey section. I would like to store all questions in the array and add question type attribute to every question. This will help us not only with translation but also render all questions dynamically. We can iterate over the array and base on type of the question render components we need. This way we can move away from hardcoding every question. I thin we can do the same with quizzes. @ngiangre @AdhamAH @salvolpe @tesla809 @SomeMoosery What do you think? |
Great! The structure is do-able. Can you make a sample @pavel-ilin for the education content and display text as well? |
@pavel-ilin @AdhamAH or anyone on front end - to finish converting Sal and I need to understand what exactly is hard coded and how values are set to defaults so we can accommodate in our data model. Can someone ping me, @nickg, on discord or comment here? |
I really still don't fully understand what are you trying to do and why it looks so complicated @ngiangre |
This is great @AdhamAH! Let’s chat on discord so we can be on the same page. |
I think just to keep things clear in terms of this issue. The end result here is that we just end up with "master" JSON files for each language, which will be stored in There is no hard and fast rule on what's hard-coded and what's not, as every component is different just by nature of building out a responsive web app. This simply requires someone going through each component and looking for where there is hardcoded text, and making sure that text is captured in the master JSON file for translations. I saw Brian was breaking his WIP master JSON file This will be tedious but having someone go through and report back where things are hardcoded and need translating wouldn't save any time, as someone then still has to go through and add those hardcoded portions into the master JSON file, and use the This will likely be an iterative process - we can always create more issues to reformat the master JSON files and subsequently update the translated values in the corresponding components. I think there is too much focus on forming a "data model" when what we really need is just a JSON file in I'm starting to fear this is becoming a bit over-engineered, as the principle behind i18next is that it's very easy to add new translations as we continue. It seems like things are taking longer due to the emphasis on finding a perfectly automated process, when we simply just need a JSON file in |
Correct @SomeMoosery - one master json for each language that will be within My goal is to get a "MVP" available - we will have every field needed in the gsheets that can then be transformed into the correct json file via python scripting with the google api. In order to get the right structure, we needed to know how you would call the tags which wasn't clear. Now it is so thanks! You're right we might not be able to get everything, but we want to get most atleast. The over-engineered part might be from detailing everything, so we'll not do that. But we did need to understand the right structure so it's usable. The data model is important so it's consistent - if not in a data model, then iterative processing/modification/adding languages will get really convoluted and 'makeshift' real fast. So I'm glad we are having this discussion! |
That's a very good point! Sounds good, since I've been somewhat away for a day or two I was just hoping to add some clarity as somewhat of an "outside" perspective to this translations bit. Seems like it's on the right track though thanks to yours and everyone's work on it, and this is one of the best discussion on an issue I think we've had 😄 |
teamwork makes the dream work! |
Done. Finishing work in #665 |
Prerequisites
Summary
Currently the education, health, and display text content for each language are three separate json files. For the front end end team to work with a particular language they need to have each language be one json file that's referenced in the locale chosen.
Motivation
This is to promote reference by the app to the proper, central language json file
Possible Alternatives
Keeping as is, which is a fragmented approach
Additional Context
This is part of the content continuous integration workflow being developed
The text was updated successfully, but these errors were encountered: