1

I have a site using Drupal 8.4.1 with all core language modules enabled, 3 active languages, and where English is the default language. The pager labels (e.g. "Last »") for my own views aren't translated, although the string "Last »" is available in the translation page. I can manually translate the pager labels by adding a translation for the whole view and then overriding the pager labels, but I think this isn't the right way to do it because the built-in views (e.g. /admin/content) are translated just fine, without any manual override.

How can pager labels be translated without manually adding the translation?

0
0

I have seen this too. Looking thru the code, it appears that the pager templates do have translations set up properly. So in theory, UI translations should work. But they don't.

I haven't tried it but you probably could do this thru the hook_preprocess_pager__page(&$variables) function (for full views pages). There seems to be a $variables['pager']['#tags'] array with the values for pagers. You might be able to do the UI string translation here.

0

Came here as I didn't found the translation tab you describe. After you have translated your View, or at least the pager buttons, export config. Then import config in all other environments. Not much manual effort required.

enter image description here

There you can change the labels.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.