Skip to content

Compile-time LANG not included #154

@LinuxBoy-96

Description

@LinuxBoy-96

@ryuichiueda This is an issue I'm reporting on your behalf.

What you're experiencing is not normal. In fact, the only way this could happen is if you compiled the program without Japanese and also without English, which is surprising — because English is always used as a fallback.

Normally, the fallback mechanism and locale detection are rock-solid.
By default, all languages are compiled into the binary, with no exceptions. Also, English is included in every language pack individually, as it serves as a universal fallback.

Let me summarize how the compilation works:

  • The default build is definied to includes all available languages, including Japanese and English.
  • The default build work by including all individual languages packs together.
  • All individual pack include engligh because it's use as a fallback but also french and japanese in the moment. But only compiled once.
  • The default is compiled wether if it is specified or not but not excluded: - cargo build --release or cargo build --release --feature "default".
  • The default build is also included in this case: - cargo build --release --features "lang_fi". lang_fi is useless here because already included.
  • Each individual language pack also includes English to guarantee fallback behavior.
    Exmple:
    cargo build --release --no-default-features --features "4" does includes english.

As such, it's almost impossible to compile without English unless it was explicitly excluded.

Now, it is technically possible to compile with no features or with only one language that doesn't match your system locale. In such a scenario, you might see the error you're getting — but this is a very niche case. When I wrote that error message, I actually had this edge case in mind.
Example:

  • cargo run --release --no-default-features
  • cargo build --release --no-default-features --features "lang_fi"

As for locale detection: we follow standard POSIX precedence:
LC_ALL > LC_MESSAGES > LANG

This is important. For example, on my system only LANG is set, and everything works as expected.
However, even if none of these variables are set, the program falls back to English. So that still doesn’t explain your error — unless no language was compiled into the binary.
Please try rebuilding the binary with the default or correct features, and let me know how it goes.

Actual behaviour:

Image

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