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

Spanish translation while on the dashboard displays hashes instead of the job status name #1304

Closed
ronb54 opened this issue Mar 29, 2024 · 3 comments · Fixed by #1307
Closed

Comments

@ronb54
Copy link

ronb54 commented Mar 29, 2024

Hello! 👋

I recently started using this gem for my project. While clicking around on the dashboard after initial setup, I toggled between translations and noticed hashes were being displayed on the job status names. A picture's worth a thousand words they say, so here's what I mean:
Screenshot 2024-03-29 at 03 08 32

See it here on the demo app as well: https://goodjob-demo.herokuapp.com/good_job/jobs?locale=es&state=scheduled.

Looks like a simple change to handle hashes in the shared _filter partial. And the es locale seems to be the only one that has multiple translations.

    status:
      discarded:
        one: Descartada
        other: Descartadas
      queued:
        one: Encolada
        other: Encoladas
  .....

All the other locales are defined with a simple string (e.g. de):

    status:
      discarded: Ausrangiert
      queued: In der Warteschlange
      retried: Wiederholt

I could do a quick PR if this hasn't been PR'd already. Let me know.

I also don't have the context for why es has the nested config. Perhaps there's a future plan for using the alternate translation?

@bensheldon
Copy link
Owner

Thanks for catching this! That's weird because it's doing the correct thing in development:

Image

The count is passed into the translation, which should determine the plural form:

<%= t(name, scope: 'good_job.status', count: count) %>

So I guess I see two problems:

  • I don't think the tabs should be pluralized (I think these are "past participles")
  • Why isn't it working the same in production as development ?? 😕

I'd accept a PR if you wanted to remove the plural forms.

@bensheldon
Copy link
Owner

Why isn't it working the same in production as development ?? 😕

Oh! In development I was running an older version (v3.26.2). I can reproduce it on main. Now to figure out what happened!

@bensheldon
Copy link
Owner

Sorry to just keep posting through it... :D

I figured it out. Those counts became asynchronous in #1286

so count is always nil now in this line:

<%= t(name, scope: 'good_job.status', count: count) %>

I'm in the code right now so I can fix it real quick right now. Thank you for reporting this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants