WordPress / openverse-frontend

The gateway to the Openverse. Openverse is a search tool for CC-licensed and public domain content across the internet.
https://wordpress.org/openverse
MIT License
71 stars 63 forks source link

Missing Translation Strings #2159

Closed bengreeley closed 1 year ago

bengreeley commented 1 year ago

Description

I noticed there are a couple of strings that aren't translated on the site at https://openverse.org. This may be something that will be taken care of in the future since the new layout just launched, but I wanted to flag it. I tested in German, but other languages also seem to be consistent with these findings.

Reproduction

  1. Go to https://openverse.org, change the language (I selected Deutsch), and a couple of strings on the homepage aren't translated:

    • 'Search for Content' in search field
    • 'All Openverse content is under a Creative Commons license or is in the public domain.' under the search field. Screenshot 2023-02-08 at 9 58 04 AM
  2. Search for content and you'll find additional untranslated strings such as https://openverse.org/de/search/?q=test

    • The 'Use' filters aren't translated
    • The 'Creator' filter isn't translated
    • The string 'Not finding what you're looking for? Try an external source:' isn't translated on the bottom of the page.

Screenshot 2023-02-08 at 9 59 21 AM

obulat commented 1 year ago

I did some investigation about this. The problem is with the translation JSON keys nested more than 2 levels deep.

https://github.com/WordPress/openverse-frontend/blob/695247ce3e8ef6a2703b3a9ac4e4e9855320041b/src/locales/scripts/read-i18n.js#L58

Here, the ancestors are only added to the direct children, but the grandchildren's ancestors array stays the same, at max 2-level deep.

dhruvkb commented 1 year ago

@obulat that makes sense, the ancestors are not populated till later so the array only holds 1 element, the parent.

That would mean that our POJO file has been incorrect 😱 since moving to JSON5. Seems like "🟥 priority: critical" would be appropriate here.