Skip to content

Commit

Permalink
fix: use metric formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed Jun 27, 2021
1 parent eaf0878 commit 4d44928
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion services/weblate/weblate-entity-count.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Joi = require('joi')
const camelcase = require('camelcase')
const { BaseJsonService } = require('..')
const { nonNegativeInteger, optionalUrl } = require('../validators')
const { metric } = require('../text-formatters')

const schema = Joi.object({
count: nonNegativeInteger,
Expand Down Expand Up @@ -55,7 +56,7 @@ function WeblateEntityCountFactory({ entityName, exampleValue }) {
]

static render({ count }) {
return { message: `${count} ${entityName}` }
return { message: `${metric(count)} ${entityName}` }
}

async handle(routeParams, { server }) {
Expand Down
3 changes: 2 additions & 1 deletion services/weblate/weblate-user-statistics.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Joi = require('joi')
const camelcase = require('camelcase')
const { BaseJsonService } = require('..')
const { nonNegativeInteger, optionalUrl } = require('../validators')
const { metric } = require('../text-formatters')

const schema = Joi.object({
translated: nonNegativeInteger,
Expand Down Expand Up @@ -66,7 +67,7 @@ function WeblateUserStatisticFactory({
]

static render({ count }) {
return { message: `${count} ${statisticName}` }
return { message: `${metric(count)} ${statisticName}` }
}

async handle({ user }, { server }) {
Expand Down

0 comments on commit 4d44928

Please sign in to comment.