Release v0.36.0
The locale can live in the URL, and now Verbaly knows it. 0.35.0 made render hand over a mirror the visitor could stand in, and within a day the docs site had written two more helpers by hand: one to ask which tree a page belongs to, one to send a visitor to their tree at all. Both are the same missing idea, that a site can put the locale in the first path segment, and Verbaly had no way to hold it. This version gives it one, closes the subpath limit that came with the link rewrite, and fixes a way the path check could read a page slug as a language. No API is removed and nothing changes for a project that keeps one URL per page.
Highlights
- Asking which language a page is in no longer needs a helper of your own.
localeFromPathanswers with the language in the URL, or with nothing when the URL does not carry one. That is a different question from what a visitor prefers, and mixing the two is what let a saved preference paint the wrong language over a page. - Verbaly can send a visitor to their language now. Turn on
render.redirectand someone landing on your home page goes to their copy before anything is drawn. Only the home page, so a search engine still reaches every page of your site directly. - A site served from a subfolder works. With
render.baseset to the folder, links in the copies point where they should instead of quietly pointing nowhere. - A page called
/es-la-guiais a page, not Spanish. Verbaly read the first part of a URL a little too eagerly, so a page whose name started like a language code could be translated into it. Now only a real language code counts. - Switching language is still a navigation on a mirrored site, and still a text swap in a single-URL app. Both are supported and the docs now say which one you are in, instead of leaving you to work it out.
For the full details of this release, see the repository changelog.