Skip to content

Use the sprintf-js library instead of format-util#735

Merged
lslezak merged 1 commit intomasterfrom
sprintf
Sep 5, 2023
Merged

Use the sprintf-js library instead of format-util#735
lslezak merged 1 commit intomasterfrom
sprintf

Conversation

@lslezak
Copy link
Copy Markdown
Contributor

@lslezak lslezak commented Sep 1, 2023

Problem

  • We use the format-util library for formatting strings, but that is too simple
  • It only supports the basic %s or %d formats and does not support more complex cases like changing the order of arguments (%2$s) which might be needed in translations

Solution

  • Lets switch to the sprintf-js library which can handle that

It also supports more formatting attributes like %2$s
volume.sizeRelevantVolumes.join(_(", "))));
conditions.push(sprintf(_("the presence of the file system for %s"),
// TRANSLATORS: conjunction for merging two list items
volume.sizeRelevantVolumes.join(_(", "))));
Copy link
Copy Markdown
Contributor Author

@lslezak lslezak Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This strange indentation is required by eslint, I guess it is a buggy behavior...

@lslezak lslezak merged commit 56e66f1 into master Sep 5, 2023
@lslezak lslezak deleted the sprintf branch September 5, 2023 07:17
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
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