Skip to content

Do not overwrite LANG on NodeJS #18816

Description

@ilonatommy

Currently int the non-deterministic mode LANG is overwritten by :

var lang = ((typeof navigator == 'object' && navigator.languages && navigator.languages[0]) || 'C').replace('-', '_') + '.UTF-8';

that is okay when we are using browser. However, when we are using NodeJS that does not have navigator, we are overwritting the LANG variable. It is really problematic because we still do not have a chance to set the desired locale.
My suggestion would be to pass the process.env.LANG if it's available.

var lang = ENVIRONMENT_IS_NODE ? process.env.LANG : ((typeof navigator == 'object' && navigator.languages && navigator.languages[0]) || 'C').replace('-', '_') + '.UTF-8';

connected past issues/PRs:
#8751
#16261
#2549

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions