mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-30 06:41:26 +00:00
Update all npm dependencies and fix discovered issues. Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 lines
392 B
TypeScript
8 lines
392 B
TypeScript
import {getCurrentLocale} from '../utils.ts';
|
|
|
|
/** frontend `Locale.TrN`: pick the `_1` or `_n` form for `count` and interpolate `%d` */
|
|
export function trN(count: number, form1: string, formN: string, {lang = getCurrentLocale()}: {lang?: string} = {}): string {
|
|
const form = new Intl.PluralRules(lang).select(count) === 'one' ? form1 : formN;
|
|
return form.replace('%d', String(count));
|
|
}
|