orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
137 stars 34 forks source link

Translate issue #98

Closed plescanos closed 2 months ago

plescanos commented 2 months ago

Hi, The power of CRUD and platform is awesome, I really love it. The only problem I have is translating to spanish (and other languages I think) I tried using the locale config, using the json lang file, creating lang file in vendor, I mean I tried everything , but I can 't trasnlate the module in the picture attached, do you have any idea where is this module or how can I rtanslate?

imagen Captura de pantalla 2024-06-19 a las 8 12 02
tabuna commented 2 months ago

To enable localization, you'll need to adjust the locale setting in the config/app.php file.

Language translations are located at https://github.com/orchidsoftware/platform/tree/master/resources/lang. You can enhance these translations as necessary.

plescanos commented 2 months ago

To enable localization, you'll need to adjust the locale setting in the config/app.php file.

Language translations are located at https://github.com/orchidsoftware/platform/tree/master/resources/lang. You can enhance these translations as necessary.

Hi, yesm is the first thign I did. Nothing happened, I jus noticed, is not crud thing, in platform screen have the same problem , in fact, I translate almost everything even making hard coding, but this particular part of platform I can't find, thanks for answer.

plescanos commented 2 months ago

Ok, I finally found the solution for this trasnlate issue. Using override process, copy table.blade.php from vendor\orchid\platform\src\Scree\Layouts to \resources\views\vendor\platform\layouts and change lines 65 to 73to language you need.

es.json (or other languages) do not work

Anyway, thanks for this powerful tool !!

<div>
                <h3 class="fw-light">
                    {!!  $textNotFound !!}
                </h3>

                 {!! $subNotFound !!}
            </div>

I just don't use both variables, I just replace for text.

plescanos commented 2 months ago

Anyway If you want to use the variables, I try to override file but do not work, so I harcoded the vendor\orchid\platform\src\Screen\Layouts\Table.php on lines 99 to 115

    protected function textNotFound(): string
    {
        if (count(request()->query()) !== 0) {
            return __('No results found for your current filters');
        }

        return __('There are no objects currently displayed');
    }

    protected function subNotFound(): string
    {
        if (count(request()->query()) !== 0) {
            return __('Try adjusting your filter settings or removing it altogether to see more data');
        }

        return __('Import or create objects, or check back later for updates');
    }