{"id":41280,"library":"i18next-formatter-stronglist","title":"i18next Strong List Formatter","description":"An i18next formatter that wraps list items in <strong> tags. This package provides a simple formatter for use with i18next and react-i18next's Trans component. When applied, it formats array values by wrapping each element in <strong> tags, useful for emphasizing list items in translations. The package is stable at version 1.0.1. There are no known similar packages providing exactly this functionality for i18next.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install i18next-formatter-stronglist","lang":"bash","label":"npm"},{"cmd":"yarn add i18next-formatter-stronglist","lang":"bash","label":"yarn"},{"cmd":"pnpm add i18next-formatter-stronglist","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a single function as default export.","wrong":"import { stronglist } from 'i18next-formatter-stronglist'","symbol":"default","correct":"import stronglist from 'i18next-formatter-stronglist'"},{"note":"Main i18next instance needed to add a formatter.","wrong":"","symbol":"i18next","correct":"import i18next from 'i18next'"},{"note":"Trans component from react-i18next is used to render translated content with formatters.","wrong":"","symbol":"Trans","correct":"import { Trans } from 'react-i18next'"}],"quickstart":{"code":"import i18next from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport stronglist from 'i18next-formatter-stronglist';\n\ni18next.use(initReactI18next).init({\n  lng: 'en',\n  resources: {\n    en: {\n      translation: {\n        keyname: 'Items: {{list, stronglist}}'\n      }\n    }\n  }\n});\n\ni18next.services.formatter?.add('stronglist', stronglist);\n\n// In your React component:\n// import { Trans } from 'react-i18next';\n// <Trans t={t} i18nKey=\"keyname\" values={{ list: ['apple', 'banana', 'cherry'] }} />\n// Renders: Items: <strong>apple</strong>, <strong>banana</strong>, <strong>cherry</strong>","lang":"typescript","description":"Shows initialization of i18next, adding the stronglist formatter, and using Trans component to render a list with strong tags."},"warnings":[{"fix":"Call i18next.services.formatter?.add('stronglist', stronglist) after i18next.init.","message":"The formatter must be added manually via i18next.services.formatter.add after initializing i18next.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the exact string 'stronglist' when adding the formatter and in the i18next key.","message":"The formatter name 'stronglist' must match exactly in the translation key: {{list, stronglist}}.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':56 'appli':32 'array':35 'compon':30 'element':40 'emphas':45 'exact':64 'format':34 'formatt':4,7,19 'function':66 'i18next':1,6,23,27,68 'item':11,47 'javascript':69 'known':60 'list':3,10,46 'packag':15,51,62 'provid':16,63 'react':26 'react-i18next':25 'similar':61 'simpl':18 'stabl':53 'strong':2 'tag':13,42 'tran':29 'translat':49 'use':21,43 'valu':36 'version':55 'wrap':9,38","created_at":"2026-06-04T18:51:38.774034+00:00","updated_at":"2026-06-04T18:51:38.774034+00:00","problems":[{"fix":"Ensure i18next version >= 21.0.0 and that you have called i18next.init() before accessing formatter.","cause":"formatter service may not be available if i18next version is older or not properly initialized.","error":"TypeError: i18next.services.formatter is undefined"},{"fix":"Install react-i18next: npm install react-i18next","cause":"Missing required peer dependency react-i18next.","error":"Module not found: Can't resolve 'react-i18next'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"i18next-formatter-stronglist","openapi_spec":null,"status_page":null,"smithery":null,"categories":["productivity"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}