Skip to content

l10n: command arguments value name is not localized #9118

@lordeji

Description

@lordeji

I'm new to localization so I tried weblate. When i was improving the translation for "split", I noticed that english value names were mixed with translated value names in the documentation.
For example :

-l, --lines <NUMBER>              mettre NOMBRE lignes/enregistrements par fichier de sortie [default: 1000]
-n, --number <CHUNKS>             générer CHUNKS fichiers de sortie ; voir l'explication ci-dessous

After looking around in the source code the culprit seems to be the Arg::value_name() function.
For example, in uu/split/src/split.rs :

pub fn uu_app() -> Command {
  Command::new(uucore::util_name())
    [...]
    .arg(
      Arg::new(OPT_LINES)
        .short('l')
        .long(OPT_LINES)
        .allow_hyphen_values(true)
        .value_name("NUMBER")
        .default_value("1000")
        .help(translate!("split-help-lines")),
    )
    [...]
}

There is two ways to deal with that :

  1. If it's voluntary, then it's necessary to write some specification so that the localization does not switch between two languages too much. Does the value name must stay in english or they can be translated while the value name stays in english as usage.
  2. Change every value_name() call to something like that
.value_name(translate!("split-help-lines-value-name"))

and update the english locale accordingly.

I would gladly take care of this task but I just need to better understand the code (i'm new to l10n) so i'm not confident if replacing the value name strings with translate!() and updating the en-US.flt files is sufficient/works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J - Localelocale related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions