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

Add the ability to customize the context locale #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add the ability to customize the context locale #9

wants to merge 1 commit into from

Conversation

gremo
Copy link

@gremo gremo commented Feb 15, 2021

Related to issue #8.

Quick overview (taken from the updated README):

contextLocale

Type: function | Default: ‌(page, config) => get(page, 'url', '').split('/')[1]

You might provide a function in order to compute the context locale (that is, the locale applied to the i18n filter when no arguments are provided). By default, this would be the first segment of the URL (/en/, /it/ and so on). If you use a custom directory strategy, like not prefixing the current locale, this option comes to help. The first argument of the function is the page object (could be undefined), the second is the plugin config object.

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

Successfully merging this pull request may close these issues.

Ability to customize the context locale (custom directory structure)
1 participant