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

Initial multilingual translation #3721

Closed
volloholic opened this issue Jul 20, 2017 · 15 comments · Fixed by #6621
Closed

Initial multilingual translation #3721

volloholic opened this issue Jul 20, 2017 · 15 comments · Fixed by #6621
Assignees
Labels
enhancement Roadmap Translation (mechanism) For issues when text should be translated but is not (or other way around); code update needed
Milestone

Comments

@volloholic
Copy link
Member

Establishment of the multi lingual functionality and translation into at least one other language. (Probably French)

@Ogik99
Copy link
Contributor

Ogik99 commented Mar 26, 2019

#4176
#5096

@dannyparsons
Copy link
Contributor

We have now decided on the approach as suggested also for Climsoft here climsoft/Climsoft#200 (comment).
This will be simpler to implement in Climsoft and so will be implemented there first before being used in R-Instat.

@isedwards
Copy link

@dannyparsons - There are three commits in the Climsoft/#592 pull request for adding language translation.

  • bb1d840 adds the command SimpleTranslateTool.translateForm(Me) to every form. You can ignore this commit. Hopefully in R-Instat all forms may inherit from a single parent base form, in which case you would only have to add this command in one place and all forms would then inherit the code.
  • 7f3a803 can also be ignored. It adds the binary SQLite file that contains translations for the Climsoft interface. R-Instat will need an equivalent file.
  • 93f2ea7 this commit contains clsSimpleTranslateTool.vb . You should be able to reuse some of this code. The majority of other changes in this commit are removing an older attempt at language translation from Climsoft (some of which is just hardcoded).

There are currently three known problems with clsSimpleTranslateTool.vb .

The first is that it used to use RESX files instead of a local SQLite database. RESX files are very limited - there is only one key and one value, therefore the implementation didn't use multiple columns for language_code, form_name etc. Instead the variables were combined into the RESX's single key using two underscores. E.g. en__mainform__titlecontrol__....

This led to obscure code like...

startswith = String.Format("{0}\_\_{1}\_\_", languageCode, frm.Name)

In SQLite it would be much better to implement this as:

language_code form_name control_name original_text translation
fr mainform lblTitle Hello World Bonjour le monde
... ... ... ... ...

The other two problems are mentioned in Climsoft/#592:

currently exceptions are raised and caught when controls are not found and also only static strings (that are defined at design time) are being translated

The easiest approach would probable be to rewrite language translation from scratch using clsSimpleTranslateTool.vb as a guide. Feel free to copy and paste any of the code that you need.

@rdstern rdstern modified the milestones: 0.9.0, 0.7.0 Mar 8, 2021
@lloyddewit
Copy link
Contributor

@maxwellfundi I will work on this issue

@rdstern rdstern added the Translation (mechanism) For issues when text should be translated but is not (or other way around); code update needed label Mar 22, 2021
@rdstern
Copy link
Collaborator

rdstern commented Mar 22, 2021

I query whether tooltips will be translated? If this is not possible initially, might it be possible in the future?

They can be useful in some dialogues and menu items. If they are translated, with the current system of producing them, then I suggest this could warrant putting more effort into producing them in more of the software.

If this is not possible in the current "system", then I wonder if it may be possible to change the way tooltips are coded, to facilitate the possibility of translation?

If this is possible, then the video team could be well placed to become also the tooltip team. I would become the tooltip producer, in the same way as I now produce the scripts.

@lloyddewit
Copy link
Contributor

@rdstern Thank you for the suggestion. I will try and translate tool tips. I am implementing translations in the order of priority below. If you prefer a different priority, then let me know, thanks

  • frmMain menu items
  • frmMain other controls (e.g. split window titles)
  • dialogs: controls with static text
  • dialogs: dynamic switching between translation and English
  • message boxes (e.g. startup and developer errors)
  • tool tips
  • dialogs: controls that have dynamically changing text

@rdstern
Copy link
Collaborator

rdstern commented Mar 23, 2021

@lloyddewit that sounds fine. And I assume this answers my main question, namely that sometime in the future tooltips will be included.

Hence, not for the sprint, but this means I should soon work with the documentation team on adding more tooltips to the software. Exciting!

@dannyparsons
Copy link
Contributor

Tooltips are just controls in VB like everything else so no reason they won't be included in the system.

@lloyddewit
Copy link
Contributor

Accidentally closed by PR #6621

@rdstern
Copy link
Collaborator

rdstern commented Aug 25, 2022

@lloyddewit I wonder about the situation regarding tooltips. For example the Prepare > Calculator dialogue has quite a lot of them? Are they done dialogue-by-dialogue or more generally?

@lloyddewit
Copy link
Contributor

@lloyddewit I wonder about the situation regarding tooltips. For example the Prepare > Calculator dialogue has quite a lot of them? Are they done dialogue-by-dialogue or more generally?

The tooltip translation mechanism is in place and working. However each time a tooltip is updated/added it needs to go through the standard JSON/CrowdIn/database process. I will try and regenerate the list of all tooltip text, and add any missing tooltip text to the JSON file for translation. This should solve the issue for most tooltips. If there are any tooltips still not translating, then we'll need to address these separately.

@lloyddewit
Copy link
Contributor

Replaced by issue #8323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Roadmap Translation (mechanism) For issues when text should be translated but is not (or other way around); code update needed
Projects
None yet
7 participants