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

Laravel 8 - missing paginator translations (tailwind) #1359

Closed
xorock opened this issue Sep 24, 2020 · 23 comments
Closed

Laravel 8 - missing paginator translations (tailwind) #1359

xorock opened this issue Sep 24, 2020 · 23 comments

Comments

@xorock
Copy link
Contributor

xorock commented Sep 24, 2020

Hello,
In Laravel 8 Tailwind paginator has new translation keys:

{!! __('Showing') !!}
<span class="font-medium">{{ $paginator->firstItem() }}</span>
{!! __('to') !!}
<span class="font-medium">{{ $paginator->lastItem() }}</span>
{!! __('of') !!}
<span class="font-medium">{{ $paginator->total() }}</span>
{!! __('results') !!}

I don't see translation in any language.

@xorock xorock changed the title Laravel 8 - missing paginator translations Laravel 8 - missing paginator translations (tailwind) Sep 24, 2020
@caouecs
Copy link
Member

caouecs commented Sep 24, 2020

it's very bad for translations... not good for right to left language, and not adaptation for results if we have just one result...

'{0} No item|[1] Showing :firstItem to :lastItem of :totalItems result |[2,*] Showing :firstItem to :lastItem of :totalItems results'

@caouecs
Copy link
Member

caouecs commented Sep 24, 2020

do you have source of this code please ?

@mohamedsabil83
Copy link
Member

mohamedsabil83 commented Sep 24, 2020

@andrey-helldar
Copy link
Member

I can see other keys accessed through the pagination (https://github.com/illuminate/pagination/blob/c5da788f8c7cf7c24a43d60b9bcf0b992457c30c/resources/views/tailwind.blade.php#L6).

I will try to send PR to the project.

@luisprmat
Copy link
Member

I had sent a PR #1361

@luisprmat
Copy link
Member

luisprmat commented Sep 24, 2020

@andrey-helldar Added "Go to page :page" to PR, the other translations seem to be

@luisprmat
Copy link
Member

@caouecs (#1359 (comment)) If there is only one result, the pagination component is not displayed by default. But it is convenient to add a PR to Laravel to improve the translation support for right-left languages

@andrey-helldar
Copy link
Member

andrey-helldar commented Sep 24, 2020

I believe that it is necessary to bring the key references in the Laravel Framework project to a single form.
Now the tailwind file contains calls to both the json file and the pagination.php file. In my opinion, this is not very good.
I have submitted PR to Taylor's projects: laravel/framework#34518 and laravel/laravel#5426

@andrey-helldar
Copy link
Member

andrey-helldar commented Sep 24, 2020

@caouecs, so we need to add a translation - Taylor refuses.

image

@mohamedsabil83
Copy link
Member

My language is RTL (Arabic) and I can say that there is no need to make any improvements to the pagination

@luisprmat
Copy link
Member

@mohamedsabil83 Those are good news!

@andrey-helldar
Copy link
Member

andrey-helldar commented Sep 24, 2020

There is a problem with the Russian language.

The full phrase in heather sounds like this:
Showing 4 to 8 of 32 results

In Russian, it will be correct:
Показано с 4 по 8 из 32 результатов

In the current scheme, the translation will be incorrect.

There are two solutions:

  1. Показано 4 - 8 из 32 результатов
"Showing": "Показано с",
"to": "по",
"of": "из",
"results": "результатов"

The second option is bad because the word "showing" can be used elsewhere.

At the same time, in Russian, the "to" particle is translated depending on the context.
For example:

Come to the table Подойти к столу
3 to 5 entries с 3 по 5 записей

Since now the word "Showing" is used only in one place, I suggest using the second option (#1362), as it is more acceptable for display.
And when this word is used somewhere else, then I will think about how best to choose the context.

@luisprmat
Copy link
Member

@andrey-helldar, in Spanish it happens exactly the same, so I applied a solution very similar to yours. I think that as long as these words ("Showing", "to", "of", ... ) are only used in the context of pagination there will be no problem. The translation does not have to be so literal, the idea is to keep the coherence of the phrase shown in this specific context.
If there are changes in the future we will review

@andrey-helldar
Copy link
Member

Exactly. Now I propose to do so, and then we'll see.

@luisprmat
Copy link
Member

At the moment it would only be missing for @caouecs to update the todo.md file to be able to close this issue! (And of course complete the translations of the other languages)

@andrey-helldar
Copy link
Member

S00924-200310

@caouecs
Copy link
Member

caouecs commented Sep 24, 2020

If they don't want to update the code, we can propose it in a package

@andrey-helldar
Copy link
Member

If they don't want to update the code, we can propose it in a package

So we sent some PRs)

@xorock
Copy link
Contributor Author

xorock commented Sep 28, 2020

@andrey-helldar
Copy link
Member

Just found another issue in base template: https://github.com/illuminate/pagination/blob/c5da788f8c7cf7c24a43d60b9bcf0b992457c30c/resources/views/tailwind.blade.php#L2
aria-label is not translated.

Thanks! I sent a PR: laravel/framework#34568

@andrey-helldar
Copy link
Member

PR was merged: laravel/framework#34568 😊

My PR for this repo: #1368

@andrey-helldar
Copy link
Member

The problem from the first message has been resolved, so I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants