Skip to content

Conversation

@jannistpl
Copy link

@jannistpl jannistpl commented Apr 14, 2025

Currently, the CLI tool i18n only supports reading the configuration from the Cargo.toml file in the root source directory.

However, in larger projects, the Cargo.toml file can quickly become very full and confusing with options from various tools.

With this PR, it is now possible to optionally create an i18n.toml file in the source root, from which the configuration can be loaded instead.

For example:

# i18n.toml
[i18n]
available-locales = ["en", "de"]
default-locale = "en"
load-path = "locales"

The priorities are then as follows:

  • If i18n.toml exists in the source root, load the configuration from there.
  • If i18n.toml doesn't exist, load the configuration from Cargo.toml.

@jannistpl jannistpl changed the title Add optional i18n.toml configuration file for the i18n CLI tool Add optional i18n.toml configuration file for the CLI tool Apr 14, 2025
@huacnlee
Copy link
Member

Sorry, we don't want induction new things, we want to keep this crate simple.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants