Sync with Nodeca Core:

- Improved translation API: `env.t` and `t.exists` in client JS.
- Improved locale detection from Accept-Languages.
- Cookies.
- `locale` persisted cookie for user-selected locale.
- Safe reading of YAML configs and i18n.