Kotahi issueshttps://gitlab.coko.foundation/kotahi/kotahi/-/issues2024-03-20T09:12:39Zhttps://gitlab.coko.foundation/kotahi/kotahi/-/issues/1563Translation overwrite file not being fully applied2024-03-20T09:12:39ZCloud68 Support teamTranslation overwrite file not being fully applied<!-- Required. Provide a general summary of the issue in the title above -->
## Expected behavior
The applied translationoverwrite is used to overwrite other translation
<!-- Required. Tell us what should happen -->
## Current behavior...<!-- Required. Provide a general summary of the issue in the title above -->
## Expected behavior
The applied translationoverwrite is used to overwrite other translation
<!-- Required. Tell us what should happen -->
## Current behavior
After rolling out a new version of Kotahi (v3.1.0) the previously working translation file is not working as intended. It is partly ignored.
<!-- Required. Tell us what happens instead of the expected behaviour -->
## Steps to reproduce
<!-- Required. Provide a link to a live example or screenshots, and the steps to reproduce this bug.]-->
1. Add a translation file
2. Restart the server or rebuild the container
3. The specified language is present on the user profile
4. The specified translated "terms" are not showing as specified on the file.
## Environment
<!-- Required. Provide relevant information such as browser name and version, PC or Mac use, internet speed, etc.]-->
## Possible solution
<!-- If known, provide details on how to fix the bug.-->
<!-- After creating this issue you can link other related or blocking issues with the Gitlab's Linked issues functionality. -->Ben WhitmoreBen Whitmorehttps://gitlab.coko.foundation/kotahi/kotahi/-/issues/1556Review page access is revoked when new version is submitted2024-03-27T11:55:06ZRyan Dix-PeekReview page access is revoked when new version is submitted## Expected behaviour
As a reviewer, I'm unable to see my previous submitted reviews under Dashboard>My reviews.
## Current behaviour
When an author submits a new version of a manuscript the, Reviewers who has previously submitted a ...## Expected behaviour
As a reviewer, I'm unable to see my previous submitted reviews under Dashboard>My reviews.
## Current behaviour
When an author submits a new version of a manuscript the, Reviewers who has previously submitted a review can no longer see their reviews - access has been revoked.
## Steps to reproduce
1. Assign a reviewer
2. Reviewer submits a review
3. Editor submits 'Revise' decision
4. Author submits a new version
4. Reviewer is unable to see previously submitted review in the Dashboard>My Reviews list, and clicking on the 'Accept' link from email notification displays a restricted access notice (token is no longer available)
## Possible solution
Related MRs;
- https://gitlab.coko.foundation/kotahi/kotahi/-/merge_requests/1103
- https://gitlab.coko.foundation/kotahi/kotahi/-/merge_requests/1124Ben WhitmoreBen Whitmorehttps://gitlab.coko.foundation/kotahi/kotahi/-/issues/1550[i18n] Form labelling translations2024-03-06T06:18:24ZBen Whitmore[i18n] Form labelling translationsSupport multiple languages for labels in dynamic forms, so that forms can be displayed in the user's selected language, both in editable and readonly mode. (This will also facilitate aspects of translations to Flax and possibly other exp...Support multiple languages for labels in dynamic forms, so that forms can be displayed in the user's selected language, both in editable and readonly mode. (This will also facilitate aspects of translations to Flax and possibly other exports -- not covered in this ticket.)
This ticket does _not_ cover data entry in multiple languages, e.g. allowing a user to enter multiple abstracts in English, Russian and French. That would need to be considered in a separate ticket.
## Labels that can be translated
When a user chooses their preferred language in the UI, this should also change the language of the following data items:
- form title (`name`)
- form description (`description` -- rich text)
- form submission-confirmation modal title (`popuptitle`)
- form submission-confirmation modal text (`popupdescription` -- rich text)
- field title (`title`)
- field short-form title (`shortDescription`)
- field description (`description` -- rich text)
- field placeholder (`placeholder`)
- select/radio/checkbox field option label (`label`)
## Data structure
Currently each of the above data items are stored as a string in the form, representing either **plain text** or **html** ('rich text'). We should in each case replace the string with an **array of `{ label: string, lang: string }`**. Example of data for a field title:
```
[{ label: 'Abstract', lang: 'en' }, { label: 'Реферат', lang: 'ru-RU' }]
```
To keep the data tidy, empty string translations should be removed from the array.
We'll need to provide migrations for existing forms to move to the new structure.
## Form-builder changes
In the form-builder, text entry components will need to change. Current state:
![image](/uploads/a19260a3a1c401f78e0131bcd77564f0/image.png)
These should change to
![image](/uploads/11859f424b80f6c3ea3ef65c780370eb/image.png)
Clicking the globe icon (`react-feather` `Globe`) toggles expanding it to the following:
![image](/uploads/259ac0766ddad8106262336892649305/image.png)
Similarly, for rich text data items:
![image](/uploads/99f83f6fa65a8466f7ee79b87fb7c15c/image.png)
The language options displayed, and the 'default' language shown when the options are collapsed, should be configured via the config manager (details below). The examples above show what would display if the default language is configured to be English, and subsequent languages are Russian and French (in that order).
When editing _required_ fields, only the default language is required.
### Alerting users to missing translations (in the form-builder)
If a form contains any translations other than the default language for _any_ data item in the form, the globe icon should be shown in warning colour for _all_ data items that don't have translations for _all_ configured languages. E.g., if the default language is English, and a form only contains English translations, globe icons should all be normal colour; but then let's say the user adds a French translation for a field placeholder text: now the globe icons of every data item in that form are displayed in warning colour unless _all_ language translations are supplied for that data item. Globe icons in warning state should have tooltips saying e.g. "Русский, Français not supplied".
## Config manager changes
In the config manager the list of supported languages can be configured: this is stored as an array of `{ label: string, lang: string }`, where the user enters the `label` as e.g. "Русский" and the `lang` as e.g. 'ru-RU'. This is displayed as a list of language items, each with two text fields ("Language name" and "ISO 639-1 tag"). Languages in the list can be reorganised, and the first in the list is taken to be the default language.
## Displaying labels in forms
The `FormTemplate` and `ReadOnlyFormTemplate` components should in each case choose the best label to display, according to what translations are available. Order of precedence is:
1. the user's current selected language
2. the default language (first language listed in config manager)
3. second language listed in config manager
4. etc.
The first available label (with a non-empty string) in this order of precedence is the label chosen for display.Ivan_AlexandrinaIvan_Alexandrina