Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggestion: don't put translation into app.php, but create separate crud #34

Open
rabol opened this issue Mar 13, 2021 · 5 comments
Open

Comments

@rabol
Copy link

rabol commented Mar 13, 2021

Please consider creating a separate language for the crud general translations

@rabol rabol changed the title Suggestion: don't put translation into app.php, but create separate Suggestion: don't put translation into app.php, but create separate crud Mar 13, 2021
@nafiesl
Copy link
Owner

nafiesl commented Mar 13, 2021

Hello @rabol, the app.php translation file only used for the general texts or labels.

For each CRUD feature, we have this master.stub file which will be replaced by the model name.

@rabol
Copy link
Author

rabol commented Mar 13, 2021

Yes, I understand, but my suggestion is to leave app.php alone and generate a new e.g. crud.php for the general translation

in app.php the following are created:


// Labels
    'table_no'          => '#',
    'total'             => 'Total',
    'action'            => 'Actions',
    'show_detail_title' => 'View :name :type detail',

    // Actions
    'show'           => 'View Detail',
    'edit'           => 'Edit',
    'delete'         => 'Delete',
    'cancel'         => 'Cancel',
    'reset'          => 'Reset',
    'delete_confirm' => 'Are you sure to delete this?',
    'delete_confirm_button' => 'YES, delete it!',

Imagine that one already have 'show' with another text like

'show' => 'Show details'

then that will be overridden by the CRUD

@nafiesl
Copy link
Owner

nafiesl commented Mar 13, 2021

You mean if we already have an existing resources/lang/en/app.php this package will replace the file content with the one that comes from the stub, @rabol?

@rabol
Copy link
Author

rabol commented Mar 13, 2021

yes, app.php is a very common lang file for the 'app' :)
But, only a suggestion, to keep backwards comaptibility you could add a parameter like --languagefile crud.php

@nafiesl
Copy link
Owner

nafiesl commented Mar 13, 2021

Ok, I got your point for to this consideration app.php is a very common.

I will consider this suggestion. I will get back to you if I have another possible solution.

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

No branches or pull requests

2 participants