-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature request: Ability to localize page's param in URL #16
Comments
Hi, I'm also interested in this. I've tried to replace |
Ive looked into this and the problem is here: public function currentPage()
{
$page = (int)($this->params['page'] ?? 1);
return max(1, $page);
} This function from Grav/Common/Uri is hardchecking the 'page' param. changing it to something like this: public function currentPage()
{
$page = (int)($this->params[Grav::instance()['language']->translate('PLUGIN_PAGINATION.PAGE')]] ?? 1);
return max(1, $page);
} does work for returning the appropriate page but may have some effects on other things |
Above does not work as it doesn't change the parameter name in the templates and I don't think that it's used so much either. I'm not sure if it's best to use translation like that, especially as it gets translated to Chinese etc.. Might be better to use something like PAGE_URL_ATTRIBUTE and add a comment to it what it is used for. |
oh yeah theres a couple more modifications that are needed for it to work, we got it working |
Ran into this issue today. Any plans to change this behavior? WordPress uses only the number of pages. |
It is great if the plugin gives an option to change "page" param in URL to something else, like for localization.
For example, I would like to have
instead of
"trang" means "page" in my language.
I looked into the code and I was able to change "page" to a different word, but the page's result was only from page 1 and the pagination only activated page 1, I couldn't browse pages 2+.
The text was updated successfully, but these errors were encountered: