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

Improve stubs adding missing translation keys #35

Closed
wants to merge 4 commits into from

Conversation

RomainMazB
Copy link
Contributor

@RomainMazB RomainMazB commented Jun 7, 2021

Leaving this as draft: I need to create some corresponding keys into the modules files and do some tests.

Also, using translation key, a little regression is needed: we can't underline the first letter which corresponds to the saving shortcut on update here because even if it would be possible to use css styling to underline the first letter, it won't be the good one in some language...

@mjauvin
Copy link
Member

mjauvin commented Jun 7, 2021

There was a similar PR on October from Alxy, it never got merged because it added the localization strings without the --include-translations argument...

see here:

octobercms/library#487

@RomainMazB
Copy link
Contributor Author

I didn't know! Thanks!

I definitely get the @alxy work here and finish it before getting this PR out of draft status.

@RomainMazB RomainMazB marked this pull request as ready for review June 8, 2021 22:27
@RomainMazB
Copy link
Contributor Author

RomainMazB commented Oct 6, 2021

@wintercms/maintainers I've added a note into the doc to generate the controller's file using this option.
This PR is ok for me, I need feedback.
The diffcheckers for the generated view files to easily understand what I'm trying to achieve:

The goal of this one is to ease the build of a multi-languages plugin without the need to go to all the generated view files to manually operate those changes.
The generated files now including core's translations keys, the controller's views are out of the box mostly compatible with any maintained language.

I agree that it's not perfect out the box: example if I'm using this in a french app into a model named "car", the delete confirmation, will be like "Êtes-vous sûr de vouloir supprimer ce car?", which -in french- is not what the plugin's developer mean (car = bus).

But still, this eases the developer work as he only needs to translate the model names and use nested translation like so:

trans('backend::lang.form.confirm_delete_name', ['name' => trans('acme.rental::lang.models.car')])

Note: it would be great if the trans method was including a fallback as parameter to avoid this: "Are you sure you want to delete acme.rental::lang.models.car?"

@LukeTowers
Copy link
Member

Replaced by wintercms/winter#486

@LukeTowers LukeTowers closed this Mar 23, 2022
@LukeTowers LukeTowers modified the milestones: v1.1.9, v1.2.0 Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants