ื›ืœื™ ื—ื™ื ืžื™

    ืžืขืฆื‘ ื•ืขื•ืจืš ื”ื•ื“ืขื•ืช i18next

    ืขืฆื‘ื• ื•ื‘ื“ืงื• ืžื—ืจื•ื–ื•ืช i18next ืขื ื”ื—ืœืคืช ืžืฉืชื ื™ื ื‘ืกื•ื’ืจื™ื™ื ืžืกื•ืœืกืœื™ื ื›ืคื•ืœื™ื, ืกื™ื•ืžื•ืช ืจื‘ื™ื (_one, _other), ืžืคืชื—ื•ืช ื”ืงืฉืจ ื•ืงื™ื ื•ืŸ.

    ืชื‘ื ื™ื•ืช14
    I18NEXT ืขื•ืจืš
    ืชื—ื‘ื™ืจ ืชืงื™ืŸ
    40 ืชื•ื•ื™ื1 ืฉื•ืจื•ืช

    ืžืฉืชื ื™ ื‘ื“ื™ืงื” ื•ืชืฆื•ื’ื” ืžืงื“ื™ืžื” ื—ื™ื”

    ืฉื ื• ืžืฉืชื ื™ื ื•ื”ื—ืœื™ืคื• ืฉืคื•ืช ื›ื“ื™ ืœืืžืช ืืช ื›ืœืœื™ ื”ืจื‘ื™ื ืฉืœ CLDR

    ืฉืคื”:
    ืคืœื˜ ืžืจื•ื ื“ืจ (en):
    Hello Sarah, welcome to our platform!
    ื™ื™ืฆื•ื ืœื”ืฆื”ืจื” ื‘ื˜ื•ื—ื” ื‘ื˜ื™ืคื•ืกื™ื ืฉืœ Intlayer
    import { type Dictionary } from 'intlayer';const convertedMessageContent = {  key: 'converted-message',  content: 'Hello {{name}}, welcome to our platform!',} satisfies Dictionary;export default convertedMessageContent;
    Intlayer ืžืืžืชืช ืชืจื’ื•ืžื™ื ื‘ื–ืžืŸ ื”ืงื•ืžืคื™ืœืฆื™ื” ืขื ื”ืฉืœืžื” ืื•ื˜ื•ืžื˜ื™ืช ืžืœืื” ืฉืœ TypeScript.

    i18next Syntax Cheat Sheet

    ื›ืœืœื™ ืชื—ื‘ื™ืจ ืžื”ื™ืจื™ื ื•ื›ื™ืฆื“ ื›ืœ ื“ืคื•ืก ืžืžื•ืคื” ืœื”ืฆื”ืจื•ืช ื‘ื˜ื•ื—ื•ืช ื‘ื˜ื™ืคื•ืกื™ื ืฉืœ Intlayer

    ืคื™ืฆ'ืจืชื—ื‘ื™ืจื“ื•ื’ืžื”ื”ืขืจื•ืชื”ืžืงื‘ื™ืœื” ื‘-Intlayer
    Interpolation{{variableName}}Hello {{user.name}}!Double curly braces, supports dot paths{{user.name}}
    Unescaped HTML{{- rawVar}}Visit {{- url}}Disables HTML escaping for raw markuphtml(...) or Markdown
    Plural Keyskey_one, key_other"item_one": "1 item", "item_other": "{{count}} items"Suffix keys based on count parameterplural({ one: "1 item", other: "{{count}} items" })
    Context Suffixkey_context"friend_female": "Girlfriend"Key appended with context parameterselect({ female: "Girlfriend", fallback: "Friend" })
    Nesting$t(nested.key)Welcome, $t(common.brand)Reuses other translation keysDirect object property reuse in TS
    Formatting{{val, format}}{{date, YYYY-MM-DD}}Passes value through custom formattersStandard JavaScript/TypeScript helper
    ื”ืืจื›ื™ื˜ืงื˜ื•ืจื” ืžื‘ื•ืกืกืช ื”ืงื•ืžืคื™ื™ืœืจ ืฉืœ Intlayer ืžื—ืœื™ืคื” ื ื™ืชื•ื— ื”ื•ื“ืขื•ืช ืžื•ืจื›ื‘ ื‘ื–ืžืŸ ืจื™ืฆื” ื‘ื‘ื˜ื™ื—ื•ืช ื˜ื™ืคื•ืกื™ื ื‘ื–ืžืŸ ืงื•ืžืคื™ืœืฆื™ื” ื•ื‘ื—ื™ืœื•ืฅ ืื•ื˜ื•ืžื˜ื™.
    ื”ืืงื•ืกื™ืกื˜ื ืฉืœ Intlayer

    ืœืขื•ืœื ืืœ ืชื“ืื’ื• ืฉื•ื‘ ืžืชื—ื‘ื™ืจ ืžื•ืจื›ื‘

    Intlayer ื”ื•ืคื›ืช ืืช ื”ื‘ื™ื ืื•ื ืœื—ื•ื•ื™ื™ืช ืคื™ืชื•ื— ืžื”ื ื” ืขื ื‘ื˜ื™ื—ื•ืช ื˜ื™ืคื•ืกื™ื ื‘ื–ืžืŸ ืงื•ืžืคื™ืœืฆื™ื”, ื—ื™ืœื•ืฅ ืื•ื˜ื•ืžื˜ื™ ืžืงื•ืžืคื•ื ื ื˜ื•ืช ื•ืฉื™ืœื•ื‘ ื—ืœืง ืขื ื”-CMS.