Comment #⁨1⁩

Toby Toby Waterhole Founder May 30, 2023

I'm not sure I quite understand the problem, so I'll just explain how the language system works.

In order to become available, languages must be registered using the Locales extender. For example, in WaterholeServiceProvider, you would add:

Extend\Locales::add('Traditional Chinese', 'zh-Hant');

Waterhole uses the following algorithm to determine which language to use:

  1. If the user has selected a language, use that. (If they are logged in, it's stored in their preferences; otherwise it's stored in the session.)
  2. Otherwise, use the closest matching preferred language from the Accept-Language header sent by the browser.

The app.locale setting is not actually used for Waterhole requests.

You should keep app.fallback_locale set to en so that any strings that don't have a zh translation will fall back to English instead of printing out the translation key.