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

Allow adding translation without build #1220

Open
cpvalente opened this issue Sep 21, 2024 · 2 comments
Open

Allow adding translation without build #1220

cpvalente opened this issue Sep 21, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@cpvalente
Copy link
Owner

cpvalente commented Sep 21, 2024

Currently, we ship with ontime a list of translated strings.

These files are maintained manually in collaboration with users.
The process for adding a new string is something like

  • copy paste en.ts into a new file zulu.ts
  • translate object values to zulu
  • add file to translationsList in TranslationProvider.tsx
  • add language to select component in GeneralPanelForm.tsx
  • make PR and wait for next release

Feature description

We would like to facilitate that users can maintain their own translations.
This means that

  • the user does not need to wait for a release
  • the user does not need to maintain their own build of the app
  • they can leverage this to tweak the wording if needed

Potential caveats

Having the translations in our codebase means that they are always in sync with the code, by extracting them, it is possible that the user provided translations could be out of sync as we add more strings. We could solve this by creating an interface for the translations and keep this up-to-date as the app changes.

Implementation details

We consider this as an advanced features for people who would know their way around the code. While we dont want them to have to wait for a release cycle, or built the app themselves. We feel it is OK to not create a custom build interface for this (at least for now)

Additional context

A possible outcome is that we need that there is no way to achieve this with reasonable cost. In which case, we can still improve the developer documentation for how to add translations based on the steps above

@cpvalente cpvalente added the good first issue Good for newcomers label Sep 21, 2024
@asharonbaltazar
Copy link
Collaborator

We consider this as an advanced features for people who would know their way around the code. While we dont want them to have to wait for a release cycle, or built the app themselves. We feel it is OK to not create a custom build interface for this (at least for now)

Would having a table with the strings and translations somewhere in settings make sense?

@cpvalente
Copy link
Owner Author

Hi @asharonbaltazar, I think a table is a passable solution. However it commits us to maintain UI to change app internals

We feel it is OK to not create a custom build interface for this (at least for now)

I would prefer looking for a solution that doesnt abstract the dataset, which would likely come at cost of convenience
Such solution could also provide a good heuristic on how to let users modify files such as the css override

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants