Skip to content
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

Support translating AMPATH Form Names via ampathformtranslations domain #221

Closed
ibacher opened this issue Feb 22, 2023 · 7 comments
Closed

Comments

@ibacher
Copy link
Member

ibacher commented Feb 22, 2023

E.g.,

{
    "uuid": "6381a458-9504-418a-b3fe-2e023e6d2550",
    "form": "Test Form 1",
    "form_name_translation": "Formulaire de Teste",
    "description": "French Translations for 'Test Form 1'",
    "language": "fr",
    "translations": {
      "Page 1": "Première page",
      "Section 1": "Première section",
      "Height": "Taille"
    }
}

Implementation-wise, this translation should override the display string for the form, similar to how other domains do this.

@Ruhanga
Copy link
Member

Ruhanga commented Mar 27, 2023

Hi @ibacher, not sure I clearly understand the goal here. IMO I'd think form_name_translation rather gets added to translations such that the frontend consuming this file is responsible for the display. Could you explain a little more how the display is consumed?

@ibacher
Copy link
Member Author

ibacher commented Mar 27, 2023

@Ruhanga Basically, form_name_translation needs to override the value shown here:

Screenshot 2023-03-27 at 08 57 28

At that point, the frontend will not have loaded either the actual form JSON or the translations JSON. It's just a request to the form endpoint to get all the forms. Basically, we just want to override the REST API's display property for the current locale.

If we force the frontend to do this processing, we force it to make:

  1. A request to get the forms
  2. A request to get the translations for the forms
  3. Parse the JSON for each for and find the form_name_translation

While each of those three steps is relatively fast, the overall effect is a massive performance hit (even imagining, f/e, a instance with 20 forms, that's 21 HTTP requests to display.... table).

Ruhanga added a commit to Ruhanga/openmrs-module-initializer that referenced this issue Mar 29, 2023
Ruhanga added a commit to Ruhanga/openmrs-module-initializer that referenced this issue Mar 29, 2023
@ibacher
Copy link
Member Author

ibacher commented Mar 29, 2023

Closed via #234

@ibacher ibacher closed this as completed Mar 29, 2023
@rbuisson
Copy link
Member

@ibacher ibacher reopened this Mar 30, 2023
@ibacher
Copy link
Member Author

ibacher commented Mar 30, 2023

Indeed, we should...

@mks-d
Copy link
Member

mks-d commented Jun 28, 2024

@ibacher is this still current or we can close this issue?

@ibacher
Copy link
Member Author

ibacher commented Jun 28, 2024

This is done.

@ibacher ibacher closed this as completed Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants