Skip to content

Allow resource specific translations for pages and buttons #10686

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

Open
wants to merge 8 commits into
base: next
Choose a base branch
from

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Apr 21, 2025

Problem

We have many translations that receive (or should receive) the current resource, for instance:

  • ra.page.create (and other similar views)
  • ra.action.create (and other similar actions)

However, in some languages such as French, some words are feminine and other masculine. This forces devs to have their own translations if they want:

  • New board : Nouveau tableau
  • New column : Nouvelle colonne

Solution

Just like we did for notifications, accept resource specific translations in the form:

  • resources.posts.page.create
  • resources.posts.action.create

Those translations should fall back to the current translations.

I identified the following translations but there may be others:

  • create default title
  • edit default title
  • show default title
  • list and infinite list default title
  • create button label

How To Test

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added the RFR Ready For Review label Apr 21, 2025
@fzaninotto
Copy link
Member

I'm a bit worried by the fact that the resource-specific translation keys for the CreateButton and the Create pages are the same. In my opinion, users should be able to have different translations for those (e.g. "Create" for the button and "New post" for the page).

@djhi
Copy link
Collaborator Author

djhi commented Apr 24, 2025

I'm a bit worried by the fact that the resource-specific translation keys for the CreateButton and the Create pages are the same. In my opinion, users should be able to have different translations for those (e.g. "Create" for the button and "New post" for the page).

They're not the same. One is page.create, the other action.create

@djhi djhi requested a review from fzaninotto April 28, 2025 18:13
@djhi djhi changed the title Allow resource specific translations for pages and <CreateButton> Allow resource specific translations for pages and buttons Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Development

Successfully merging this pull request may close these issues.

3 participants