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

feat(frontend): make language selection for translations more intuitive #461

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

perierc
Copy link
Contributor

@perierc perierc commented Mar 22, 2024

What

The PR modifies the translations section of the edit entry page:

  • Changes "All languages" terminology to "Fallback translations" (QW: Change "all languages" terminology (xx) #458)
  • Adds an info alert if "en" (English) or "xx" (Fallback translations) is not the main language for an entry (QW: add a warning if english or xx is not the main language for an entry #457)
  • Fixes the fact that the alert message about changing the display name of a language appears even if the language had no translations and we add the first one ([QW] only display message about changing first entry if lang was not empty #459)
  • Adds a "Show all existing translations" checkbox to see all the languages that currently have translations, with their translations
  • Adds a possibility to "pin" languages to select them (so they stay in local storage and appear at the top for each entry), and a possibility to hide (unselect) these languages easily (with an icon next to their title)
  • Modifies the selection of new languages: I removed the "number of languages shown" button that had to be clicked to add a language, and created a "Show another language" button at the bottom of the section. Also, the dialog is now an autocomplete instead of a select, and you just type the languages that you want to add and see languages that are not selected, instead of seeing all current languages and being able to remove them. The autocomplete with the options is also automatically focused when opening the dialog.
  • Adds vite-plugin-svgr to easily import svg files in React

Screenshot

Screen.Recording.2024-03-22.at.11.51.34.mov
image

Part of

Charles Perier added 2 commits March 20, 2024 19:13
… or xx is not the main language, only display message about changing first translation if lang was not empty)
Copy link
Contributor

@Piv94165 Piv94165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR!

Everything seems to be functioning smoothly from my end. One thing I might suggest is consulting with taxonomy experts regarding the naming convention for fallback languages, as Alizarine mentioned that she wasn't sure to understand the term. However, this can be addressed in a separate PR.

One minor issue I noticed is a peculiar behavior: when we display all existing languages, pin one from the list, and then hide it, it doesn't disappear (presumably because all existing languages are checked). Perhaps there's a better approach to handling this scenario. Nevertheless, I don't consider it critical enough to block the PR.

Great work overall!

@alexgarel
Copy link
Member

Tested ok !

@alexgarel alexgarel merged commit 4119aed into main Mar 27, 2024
8 checks passed
@alexgarel alexgarel deleted the perierc/make-language-selection-intuitive branch March 27, 2024 15:33
perierc added a commit that referenced this pull request Apr 11, 2024
* feat(frontend): make language selection for translations more intuitive (#461)

The PR modifies the translations section of the edit entry page:

* Changes "All languages" terminology to "Fallback translations" (fixes #458)
* Adds an info alert if "en" (English) or "xx" (Fallback translations) is not the main language for an entry (fixes #457)
/ Fixes the fact that the alert message about changing the display name of a language appears even if the language had no translations and we add the first one (fixes #459)
* Adds a "Show all existing translations" checkbox to see all the languages that currently have translations, with their translations Adds a possibility to "pin" languages to select them (so they stay in local storage and appear at the top for each entry), and a possibility to hide (unselect) these languages easily (with an icon next to their title)
* Modifies the selection of new languages: I removed the "number of languages shown" button that had to be clicked to add a language, and created a "Show another language" button at the bottom of the section. Also, the dialog is now an autocomplete instead of a select, and you just type the languages that you want to add and see languages that are not selected, instead of seeing all current languages and being able to remove them. The autocomplete with the options is also automatically focused when opening the dialog.
* Adds vite-plugin-svgr to easily import svg files in React

---------

Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local>

* feat: add property filter to search API (#456)

* feat: add property filter to search API

* chore: generate SDK

* chore: Add info banners on the frontend (#473)

* docs: add info banners

* refactor: delete unnecessary components

* fix: add line break

* improve search results, and few other improvements

* show translations instead of translated languages

---------

Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local>
Co-authored-by: Eric Nguyen <ericnguyen.developper@gmail.com>
Piv94165 added a commit that referenced this pull request Apr 11, 2024
* working on component querying backend

* feat(frontend): link advanced research component with backend

* feat(frontend): add parent, child, ancestor, descendant filter

* feat(frontend): disable modified filter with comment

* feat(frontend): add search results with pagination

* feat(frontend): search expression is refactored by backend

* refactor(frontend): replace search page, avoid useeffect and many rerenders

* refactor(frontend): a file for each main component

* feat(frontend): is:external and is:not:external filter

* feat(frontend): add external filter

* refactor(frontend): clean code, add error message if needed

* lint

* refactor(frontend): change multiple select filter behaviour

* refactor(frontend): remove useless states and props

* feat(frontend): unify design with select and inputs components only

* refactor(frontend): refactor singleSelectFilter

* feat: improve search results display (#484)

* feat(frontend): make language selection for translations more intuitive (#461)

The PR modifies the translations section of the edit entry page:

* Changes "All languages" terminology to "Fallback translations" (fixes #458)
* Adds an info alert if "en" (English) or "xx" (Fallback translations) is not the main language for an entry (fixes #457)
/ Fixes the fact that the alert message about changing the display name of a language appears even if the language had no translations and we add the first one (fixes #459)
* Adds a "Show all existing translations" checkbox to see all the languages that currently have translations, with their translations Adds a possibility to "pin" languages to select them (so they stay in local storage and appear at the top for each entry), and a possibility to hide (unselect) these languages easily (with an icon next to their title)
* Modifies the selection of new languages: I removed the "number of languages shown" button that had to be clicked to add a language, and created a "Show another language" button at the bottom of the section. Also, the dialog is now an autocomplete instead of a select, and you just type the languages that you want to add and see languages that are not selected, instead of seeing all current languages and being able to remove them. The autocomplete with the options is also automatically focused when opening the dialog.
* Adds vite-plugin-svgr to easily import svg files in React

---------

Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local>

* feat: add property filter to search API (#456)

* feat: add property filter to search API

* chore: generate SDK

* chore: Add info banners on the frontend (#473)

* docs: add info banners

* refactor: delete unnecessary components

* fix: add line break

* improve search results, and few other improvements

* show translations instead of translated languages

---------

Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local>
Co-authored-by: Eric Nguyen <ericnguyen.developper@gmail.com>

* refactor(frontend): remove useless lines, add css

* rewording

* test

---------

Co-authored-by: alice.juan <alice.juan@student-cs.fr>
Co-authored-by: Charles Perier <82757576+perierc@users.noreply.github.com>
Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local>
Co-authored-by: Eric Nguyen <ericnguyen.developper@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
3 participants