Open NightSkySK opened 4 months ago
If your browser is requesting the page in polish, this is what the server will return. The "default" language selection is intended as a back-stop after other language selection priorities are exhausted.
From the django documentation:
LocaleMiddleware tries to determine the user’s language preference by following this algorithm:
- First, it looks for the language prefix in the requested URL. This is only performed when you are using the i18n_patterns function in your root URLconf. See [Internationalization: in URL patterns](https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#url-internationalization) for more information about the language prefix and how to internationalize URL patterns.
- Failing that, it looks for a cookie. The name of the cookie used is set by the [LANGUAGE_COOKIE_NAME](https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-LANGUAGE_COOKIE_NAME) setting. (The default name is django_language.)
- Failing that, it looks at the Accept-Language HTTP header. This header is sent by your browser and tells the server which language(s) you prefer, in order by priority. Django tries each language in the header until it finds one with available translations.
- Failing that, it uses the global [LANGUAGE_CODE](https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-LANGUAGE_CODE) setting.
OK, I understand it's not a bug in this case. Can it be "feature-request" to store user preferred language in user settings? in this case login page would be still based on "language selection priorities" mentioned above, but once user successfully login it would switch to the preferred language/language which he was using during last session, etc.
@NightSkySK this is possible with the new user interface, but likely not with the current "legacy" interface.
This issue seems stale. Please react to show this is still important.
Please verify that this bug has NOT been raised before.
Describe the bug*
in Inventree config file
/etc/inventree/config.yaml
I've applied language setting:How ever once I launch Inventree it's set up language to Polish by default:
Even if I save the setting for my account to
English
it return back toPolish
after some time. Also language setting seems to not be stored in account setting as in new browser it display all inPolish
as well.Steps to Reproduce
language: en-us
Expected behaviour
Deployment Method
Version Information
Version Information:
InvenTree-Version: 0.15.4 Django Version: 4.2.12
Database: postgresql Debug-Mode: False Deployed using Docker: False Platform: Linux-5.4.0-186-generic-x86_64-with-glibc2.31 Installer: None
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'Zebra', 'slug': 'zebra', 'version': '0.6.0'}, {'name': 'KiCadLibraryPlugin', 'slug': 'kicad-library-plugin', 'version': '1.4.2'}]
Please verify if you can reproduce this bug on the demo site.
Relevant log output
No response