Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Conversation

lslezak
Copy link
Member

@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
Member 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
8 of 10 checks passed
@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.

None yet

2 participants