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

Remove untranslated locales from page generation and the locale chooser #4224

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

zackkrida
Copy link
Member

Fixes

Fixes #4196 by @zackkrida

Description

Removes untranslated locales from the frontend.

Testing Instructions

Run the frontend locally and verify that no languages in untranslated-locales.json are present in the locale chooser in the site footer.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
@zackkrida zackkrida requested a review from a team as a code owner April 29, 2024 20:04
@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Apr 29, 2024
@openverse-bot openverse-bot added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature ♿️ aspect: a11y Concerns related to the project's accessibility labels Apr 29, 2024
Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

Approving contingent on asking whether it's worth holding off on this as strictly part of the Nuxt 3 experimentation or if we definitely wish to exclude these now, even with our current non-technically problematic handling of very many routes. Fine by me, just wanted to clarify for sure (the issue is ambiguous about this in light of the relationship to the Nuxt 3 work).

@zackkrida
Copy link
Member Author

@sarayourfriend I see this as a significant user experience improvement that was identified by and happens to be relevant to the Nuxt 3 experimentation project. It's worth doing as soon as we can in its own right to make the locale chooser more useful.

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

I'm surprised at how small the change was :) We remove ~130 items from the list.

@dhruvkb
Copy link
Member

dhruvkb commented Apr 30, 2024

We removed 130?! That's a lot, almost two-thirds of the close to 200 locales in total. Sad to see and hard to believe they were all 0% translated.

@dhruvkb dhruvkb removed their request for review April 30, 2024 04:56
@zackkrida zackkrida merged commit 0ebbd18 into main Apr 30, 2024
58 of 61 checks passed
@zackkrida zackkrida deleted the fix-4196 branch April 30, 2024 14:51
@mpQadir
Copy link

mpQadir commented May 1, 2024

Add Saraiki in locale chooser. Saraiki is being translated,

@sarayourfriend
Copy link
Contributor

@mpQadir Thanks for the ping. Our script is meant to automatically include locales once they have translated strings, which I thought would cover what you're asking... However, I checked and saw that Saraiki isn't in our list. Because you said it is being translated, I kept looking, and I think there might be a bug in our script or integration with Glotpress, because Saraiki has a 0% translation when our script downloads it, even though there are 64 translations for Saraiki. @WordPress/openverse-frontend are any of y'all equipped to look into this? Saraiki definitely has translated strings, but when I run i18n:get-translations locally, it ends up in the untranslated locales list and saying it is 0% translated. Am I missing something about the implementation of the script? Should I create an issue for this?

@dhruvkb
Copy link
Member

dhruvkb commented May 1, 2024

I tried it just now @sarayourfriend and it's appearing in the valid list of locales for me and showing up in the chooser as well.

Screenshot 2024-05-01 at 6 38 50 AM

I suspect that because these translations have been added very recently and frontend staging has not had a chance to be deployed since, Saraiki was not a valid language when this PR was merged. I'm very confident that Saraiki will be added to staging in the next deploy.

Additionally, I logged the output in the console and skr is in the translated list now.
Screenshot 2024-05-01 at 6 44 26 AM

@sarayourfriend
Copy link
Contributor

Okay! I wonder if I did something wrong when I tried it just now. Thanks for checking and confirming it will go in. @mpQadir just to clarify for you, that means Saraiki should start appearing on openverse.org sometime next week.

@mpQadir
Copy link

mpQadir commented May 1, 2024 via email

@mpQadir
Copy link

mpQadir commented May 19, 2024

@sarayourfriend @dhruvkb Please Saraiki language be deployed in the website in locale chooser. It is not appearing. Waiting

@zackkrida
Copy link
Member Author

Hi @mpQadir, you've actually helped reveal a bug in Openverse. We currently only include languages which use languages defined in the https://en.wikipedia.org/wiki/ISO_639-1 specification. Saraiki is in version 639-3 https://iso639-3.sil.org/code/skr.

I will make a pull request to fix this today. Thank you!

@zackkrida
Copy link
Member Author

Hello @mpQadir, following up on your very useful messages, Saraiki is now available on Openverse:

https://openverse.org/skr

Thank you so much for your help here and your translations.

@mpQadir
Copy link

mpQadir commented May 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿️ aspect: a11y Concerns related to the project's accessibility ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
6 participants