Skip to content

Add preferred way of extracting pluralize-able strings into constants.js

What does this MR do?

Adds a recommended way to approach extracting pluralize-able translation strings from Vue files into reusable locations (such as a constants.js file).

The recommendation is to create a function in the constants.js file which takes a count argument:

const translator = (count) => n__('singular', 'plural', count);

Screenshots (strongly suggested)

I’m not sure how to build the docs locally, but I can give you the before-and-after of how it’s rendered for me in VS Code 😄

Before After
image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #333874

Merge request reports