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

Show translations in profile languages #2791

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

jiru
Copy link
Member

@jiru jiru commented May 18, 2021

This PR changes the way the "show n more translations" button works.
Before, it hid all translations that appeared after the 5th one.
With this PR, the behavior is:

  • if you are logged in and have more than one language listed in your profile, hide all translations that are in languages not listed in your profile
  • otherwise, hide all translations that appears after the 5th one

Note that there is a performance problem on the new design: when there are lots of translations, it can take more than a second for the all the translations to appear after clicking the expand button. This PR could make this problem even more of a burden.

Note that this PR makes the expand/collapse to always show up on the old design regardless of the user setting.

For these reasons, I left the PR as draft. Feel free to suggest changes or even take over this PR by pushing new commits to the associated branch.

jiru added 6 commits May 5, 2021 19:26
This commit changes the behavior of the expand/collapse
translations button in the new design. Now, unless a
particular language is selected in "Show translations in":

- if the user has two profile languages or more, then hide
  non-profile-language translations behind the
  expand/collapse button.

- if the user is logged out or has one profile language or
  less, then keep the existing behavior of only showing the
  first five translations.

This will hopefully show more relevant results by default.
So that it’s gonna be easier to add custom entries.
This commit changes the behavior of the expand/collapse
translations button in the old design. Now, unless a
particular language is selected in "Show translations in":

- if the user has two profile languages or more, then hide
  non-profile-language translations behind the
  expand/collapse button.

- if the user is logged out or has one profile language or
  less, then keep the existing behavior of only showing the
  first five translations.

This will hopefully show more relevant results by default.
This variable counts sentences that are initially
hidden, so it should be named "hidden" or
"toDisplay" or similar.
Now that this button can hide *all* the
translations, it would not make sense to make it
say "show n more translations" in that case.

Also included the icon inside the translatable
string to allow translators to put it at a
different place (this should be useful for RTL
languages).
Apply the same changes as in
46c8d6b
on the new design.
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

Successfully merging this pull request may close these issues.

1 participant