Laravel-Backpack / LangFileManager

A quick interface to edit Laravel language files, for Backpack.
http://backpackforlaravel.com
MIT License
92 stars 42 forks source link

Support Tabs for langueange file layers and plural forms #81

Closed guleswine closed 2 years ago

guleswine commented 3 years ago

Hi guys. When I tried this package for the first time, I ran into the inconvenience of maintaining a lot of data After a few months of working with the backpack, I decided to fix this issue and share with the community.

For nested arrays, tabs are created instead of a header, and fill in multiple forms of the language also used to tabs for save space . image image

welcome[bot] commented 3 years ago

BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.

Please keep in mind that:

Thank you!

-- Justin Case The Backpack Robot

guleswine commented 3 years ago

Someone here? 😀 Should i do something else?

promatik commented 3 years ago

Hi @guleswine! I took a look at your PR, and its amazing, I think I've needed this before 😅 And this is a great core feature! Good job, thank you!

I have only one concern 😬 You did this in a way that, when there is nested content, all the main entries appear as a tab, and this may lead to have dozens of tabs.

Take this example:

auth.php

return [
    'translation-of-a' => 'a',
    'translation-of-b' => 'b',
    'translation-of-c' => 'c',
    ...

    'other' => [
        'translation-of-a' => 'a',
        'translation-of-b' => 'b',
        ...
    ],
];

Generates this; image


What do you think about having a first tab, that aggregates all the root elements? It could be called main or rootor it could have the name of the it's file ...

image

Please let me know what you think about it ✌

By the way, backpack is in a feature freeze state right now, we're getting v4.2 ready 🙌 but we'll take a look at this as soon as possible.

tabacitu commented 2 years ago

Hey guys,

Thanks for the work you've put in @guleswine ! We super-appreciate it 🙏 Please forgive us for taking so long to reply, this package in particular is one we're not very happy with, and in which we haven't invested time in a long long time.

But... I don't think this interface is the one we'll be going with, for LangFileManager. I find the amount of tabs confusing as a user. I think a simpler interface is needed. And the simplest I can think of is... a table. In fact... I think we can use the CRUD table (or similar) which will show all translation strings, if:

139646240-6a5a31aa-d260-45eb-8a8e-14eb73372fad

Editable columns are coming after we launch Backpack 4.2 (as a closed-source package). So I'm going to postpone our work on this package until then.

In the meantime (because it might take us a while), please feel free to use it as you built it. Or even create a fork or separate package starting from LangFileManager (it's MIT-licensed after all). The more options, the better!

Sorry I'll be closing this, I guess it's a matter of opinion here, but I really want the interface to be as simple as possible for the user. Most of the time we give this interface to non-tech people and they definitely would be scared of this many tabs.

Again, thank you so much for taking the time to submit this, and to share it with the community.

Cheers!