Release v0.41.0
The library shipped halves and expected you to assemble them. 0.40.0 named where the language lives in your URLs and then picked the wrong default for it, telling a plain single-page app it had one URL tree per language when it had none. Fixing that exposed the bigger half: Verbaly has always shipped a complete language switcher for one mode and a spare part for the other, so every project wrote the second one by hand, ours included. Rewriting our own site on the library's own helper found a bug that has been there since the switcher moved into core: a visitor who chose a language was sent back to their browser's language on the next page load. No API is removed.
Highlights
- Switching language is one line now, and it is the same line whichever way your URLs work.
switchLocalenavigates when the language is in the address and swaps the text where it stands when it is not, and you no longer have to know which. - Your choice of language survives the next page load. Picking English on a Spanish page could send you straight back to Spanish, because the switch remembered your choice in one place and the page that greets you read another.
- Verbaly stops guessing that you want the language in your addresses. It reads your setup: if you build a version of your site per language you get addresses per language, and if you do not, one address serves all of them. You only write it down to disagree.
verbaly doctortells you whether it read your choice or worked it out, so a mode nobody wrote down never looks like a decision somebody made.- The size gate now measures what a real app actually ships, not just the smallest possible import and the largest impossible one.
For the full details of this release, see the repository changelog.