[{"data":1,"prerenderedAt":683,"buildId":684},["ShallowReactive",2],{"docs:\u002Fintegrations\u002Fx18n":3},{"page":4,"section":16,"document":17,"credits":10,"prev":675,"next":679},{"id":5,"path":6,"file":7,"title":5,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"x18n","\u002Fintegrations\u002Fx18n","integrations\u002Fx18n.md","x18n integration","Check source locale messages and hard-coded strings with the glosslint x18n plugin and export your corpus to x18n's glossary.",null,[],"i-lucide-languages","article",true,2,"integrations",{"nodes":18,"toc":669},[19,45,53,70,200,206,273,279,282,343,351,416,422,431,434,468,471,477,483,533,556,654],[20,21,22,23,27,28,32,33,36,37,40,41,44],"p",{},"Use ",[24,25,26],"code",{},"glosslint\u002Fx18n"," when your project manages translations with ",[29,30,5],"a",{"href":31},"https:\u002F\u002Fgithub.com\u002Fx18n-dev\u002Fx18n",". The plugin checks your source locale's messages and the hard-coded strings x18n finds, and ",[24,34,35],{},"toX18nGlossary"," turns your corpus into x18n's ",[24,38,39],{},"glossary"," so translators and machine translation see the same terms. ",[24,42,43],{},"@x18n\u002Fcore"," is an optional peer dependency.",[46,47,52],"h2",{"id":48,"anchor":49},"setup",{"label":50,"icon":51},"Section titled \"Setup\"","#","Setup",[20,54,55,56,58,59,62,63,65,66,69],{},"Import ",[24,57,35],{}," from ",[24,60,61],{},"glosslint"," and the plugin from ",[24,64,26],{},", then wire both into ",[24,67,68],{},"x18n.config.ts",":",[71,72,75],"pre",{"language":73,"filename":68,"class":74},"ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,76,78,87,88,87,108,87,122,87,136,87,150,87,152,87,168,87,181,87,193],{"class":77},"language-ts",[79,80,83],"span",{"class":81,"style":82},"line","display: inline",[79,84,86],{"style":85},"color:#6E7781;--shiki-dark:#8B949E","\u002F\u002F x18n.config.ts","\n",[79,89,90,94,98,101,105],{"class":81,"style":82},[79,91,93],{"style":92},"color:#CF222E;--shiki-dark:#FF7B72","import",[79,95,97],{"style":96},"color:#1F2328;--shiki-dark:#E6EDF3"," { defineConfig } ",[79,99,100],{"style":92},"from",[79,102,104],{"style":103},"color:#0A3069;--shiki-dark:#A5D6FF"," \"@x18n\u002Fcore\"",[79,106,107],{"style":96},";",[79,109,110,112,115,117,120],{"class":81,"style":82},[79,111,93],{"style":92},[79,113,114],{"style":96}," { toX18nGlossary } ",[79,116,100],{"style":92},[79,118,119],{"style":103}," \"glosslint\"",[79,121,107],{"style":96},[79,123,124,126,129,131,134],{"class":81,"style":82},[79,125,93],{"style":92},[79,127,128],{"style":96}," glosslint ",[79,130,100],{"style":92},[79,132,133],{"style":103}," \"glosslint\u002Fx18n\"",[79,135,107],{"style":96},[79,137,138,140,143,145,148],{"class":81,"style":82},[79,139,93],{"style":92},[79,141,142],{"style":96}," corpus ",[79,144,100],{"style":92},[79,146,147],{"style":103}," \".\u002Fglosslint.config.ts\"",[79,149,107],{"style":96},[79,151],{"class":81,"style":82},[79,153,154,157,160,164],{"class":81,"style":82},[79,155,156],{"style":92},"export",[79,158,159],{"style":92}," default",[79,161,163],{"style":162},"color:#8250DF;--shiki-dark:#D2A8FF"," defineConfig",[79,165,167],{"style":166},"color:#953800;--shiki-dark:#FFA657","({",[79,169,170,173,175,178],{"class":81,"style":82},[79,171,172],{"style":96},"  plugins: [",[79,174,61],{"style":162},[79,176,177],{"style":96},"({ corpus })]",[79,179,180],{"style":166},",",[79,182,183,186,188,191],{"class":81,"style":82},[79,184,185],{"style":96},"  glossary: ",[79,187,35],{"style":162},[79,189,190],{"style":96},"(corpus)",[79,192,180],{"style":166},[79,194,195,198],{"class":81,"style":82},[79,196,197],{"style":166},"})",[79,199,107],{"style":96},[46,201,205],{"id":202,"anchor":203},"options",{"label":204,"icon":51},"Section titled \"Options\"","Options",[207,208,209,225],"table",{},[210,211,212],"thead",{},[213,214,215,219,222],"tr",{},[216,217,218],"th",{},"Option",[216,220,221],{},"Default",[216,223,224],{},"What it does",[226,227,228,242,255],"tbody",{},[213,229,230,236,239],{},[231,232,233],"td",{},[24,234,235],{},"corpus",[231,237,238],{},"required",[231,240,241],{},"The corpus.",[213,243,244,249,252],{},[231,245,246],{},[24,247,248],{},"sourceLocale",[231,250,251],{},"the project's source locale",[231,253,254],{},"The locale whose messages are checked.",[213,256,257,262,265],{},[231,258,259],{},[24,260,261],{},"kindOf",[231,263,264],{},"none",[231,266,267,268,272],{},"Decides a message's kind before glosslint does. See ",[29,269,271],{"href":270},"\u002Fguide\u002Fcasing","Casing rules",".",[46,274,278],{"id":275,"anchor":276},"checks",{"label":277,"icon":51},"Section titled \"Checks\"","Checks",[20,280,281],{},"The plugin registers three checks in x18n:",[207,283,284,297],{},[210,285,286],{},[213,287,288,291,294],{},[216,289,290],{},"Check",[216,292,293],{},"Default severity",[216,295,296],{},"Reports",[226,298,299,314,329],{},[213,300,301,306,309],{},[231,302,303],{},[24,304,305],{},"glosslint-term",[231,307,308],{},"error",[231,310,311],{},[24,312,313],{},"GLOSSLINT_TERM",[213,315,316,321,324],{},[231,317,318],{},[24,319,320],{},"glosslint-avoid",[231,322,323],{},"warning",[231,325,326],{},[24,327,328],{},"GLOSSLINT_AVOID",[213,330,331,336,338],{},[231,332,333],{},[24,334,335],{},"glosslint-case",[231,337,308],{},[231,339,340],{},[24,341,342],{},"GLOSSLINT_CASE",[20,344,345,346,348,349,69],{},"To change a check's severity, override it under ",[24,347,275],{}," in ",[24,350,68],{},[71,352,353],{"language":73,"filename":68,"class":74},[24,354,355,87,365,87,375,87,385,87,390,87,403,87,410],{"class":77},[79,356,357,359,361,363],{"class":81,"style":82},[79,358,156],{"style":92},[79,360,159],{"style":92},[79,362,163],{"style":162},[79,364,167],{"style":166},[79,366,367,369,371,373],{"class":81,"style":82},[79,368,172],{"style":96},[79,370,61],{"style":162},[79,372,177],{"style":96},[79,374,180],{"style":166},[79,376,377,379,381,383],{"class":81,"style":82},[79,378,185],{"style":96},[79,380,35],{"style":162},[79,382,190],{"style":96},[79,384,180],{"style":166},[79,386,387],{"class":81,"style":82},[79,388,389],{"style":96},"  checks: {",[79,391,392,395,398,401],{"class":81,"style":82},[79,393,394],{"style":103},"    \"glosslint-avoid\"",[79,396,397],{"style":96},": ",[79,399,400],{"style":103},"\"error\"",[79,402,180],{"style":96},[79,404,405,408],{"class":81,"style":82},[79,406,407],{"style":96},"  }",[79,409,180],{"style":166},[79,411,412,414],{"class":81,"style":82},[79,413,197],{"style":166},[79,415,107],{"style":96},[46,417,421],{"id":418,"anchor":419},"message-kinds-and-fixes",{"label":420,"icon":51},"Section titled \"Message kinds and fixes\"","Message kinds and fixes",[20,423,424,425,427,428,430],{},"A message's key decides whether its value is a label, a header, or a sentence, following the rules in ",[29,426,271],{"href":270},". If the key does not place the message, glosslint falls back to the text's shape. Pass ",[24,429,261],{}," to decide specific keys or files yourself before glosslint runs.",[20,432,433],{},"Fixes depend on the finding kind and how the message's kind was decided:",[435,436,437,453,462],"ul",{},[438,439,440,444,445,448,449,452],"li",{},[441,442,443],"strong",{},"Safe fixes."," Spelling and casing findings in messages carry a safe fix that ",[24,446,447],{},"x18n check --fix"," applies, except ",[24,450,451],{},"context"," terms in messages placed only by shape.",[438,454,455,458,459,461],{},[441,456,457],{},"Quick fixes."," A ",[24,460,451],{}," casing fix in a message placed only by its shape is offered as a quick fix you pick yourself, rather than a safe fix, because the shape guess might be wrong.",[438,463,464,467],{},[441,465,466],{},"No fix."," Avoid words and hard-coded strings get no fix. Avoid words need a person to verify the meaning first, and x18n does not edit source files for hard-coded strings outside extraction.",[20,469,470],{},"When one message has several safe fixes, each safe fix applies all of them at once, and each finding also keeps a quick fix that changes only its own span.",[46,472,476],{"id":473,"anchor":474},"exporting-your-corpus-to-x18ns-glossary",{"label":475,"icon":51},"Section titled \"Exporting your corpus to x18n's glossary\"","Exporting your corpus to x18n's glossary",[20,478,479,482],{},[24,480,481],{},"toX18nGlossary(corpus)"," maps every term in your corpus to an x18n glossary entry:",[435,484,485,509,521],{},[438,486,487,490,491,494,495,498,499,501,502,504,505,272],{},[24,488,489],{},"term",", ",[24,492,493],{},"translations",", and ",[24,496,497],{},"forms"," are passed through as written. Define ",[24,500,493],{}," and ",[24,503,497],{}," per locale on each term as described in ",[29,506,508],{"href":507},"\u002Fguide\u002Fterms","Defining terms",[438,510,511,514,515,501,518,272],{},[24,512,513],{},"note"," combines the term's ",[24,516,517],{},"description",[24,519,520],{},"nuance",[438,522,523,526,527,530,531,272],{},[24,524,525],{},"doNotTranslate: true"," is set on every ",[24,528,529],{},"exact"," term that has no ",[24,532,493],{},[20,534,535,536,539,540,501,542,544,545,548,549,552,553,555],{},"For example, given ",[24,537,538],{},"Dock"," (with German ",[24,541,493],{},[24,543,497],{},") and ",[24,546,547],{},"eBike"," (",[24,550,551],{},"case: \"exact\""," with no translations), ",[24,554,481],{}," produces:",[71,557,558],{"language":73,"class":74},[24,559,560,87,565,87,570,87,580,87,590,87,606,87,616,87,621,87,625,87,634,87,645,87,649],{"class":77},[79,561,562],{"class":81,"style":82},[79,563,564],{"style":96},"[",[79,566,567],{"class":81,"style":82},[79,568,569],{"style":96},"  {",[79,571,572,575,578],{"class":81,"style":82},[79,573,574],{"style":96},"    term: ",[79,576,577],{"style":103},"\"Dock\"",[79,579,180],{"style":96},[79,581,582,585,587],{"class":81,"style":82},[79,583,584],{"style":96},"    translations: { de: ",[79,586,577],{"style":103},[79,588,589],{"style":96}," },",[79,591,592,595,598,600,603],{"class":81,"style":82},[79,593,594],{"style":96},"    forms: { de: [",[79,596,597],{"style":103},"\"Dockingstation\"",[79,599,490],{"style":96},[79,601,602],{"style":103},"\"Dockingstationen\"",[79,604,605],{"style":96},"] },",[79,607,608,611,614],{"class":81,"style":82},[79,609,610],{"style":96},"    note: ",[79,612,613],{"style":103},"\"A powered stand where one bike is locked. A station is a group of docks.\"",[79,615,180],{"style":96},[79,617,618],{"class":81,"style":82},[79,619,620],{"style":96},"  },",[79,622,623],{"class":81,"style":82},[79,624,569],{"style":96},[79,626,627,629,632],{"class":81,"style":82},[79,628,574],{"style":96},[79,630,631],{"style":103},"\"eBike\"",[79,633,180],{"style":96},[79,635,636,639,643],{"class":81,"style":82},[79,637,638],{"style":96},"    doNotTranslate: ",[79,640,642],{"style":641},"color:#0550AE;--shiki-dark:#79C0FF","true",[79,644,180],{"style":96},[79,646,647],{"class":81,"style":82},[79,648,620],{"style":96},[79,650,651],{"class":81,"style":82},[79,652,653],{"style":96},"]",[20,655,656,657,661,662,664,665,668],{},"See ",[29,658,660],{"href":659},"\u002Freference\u002Fapi","API reference"," for the ",[24,663,35],{}," function and ",[24,666,667],{},"X18nGlossaryEntry"," type.",[670,671,672,673,674],{"id":48,"depth":15,"text":52},{"id":202,"depth":15,"text":205},{"id":275,"depth":15,"text":278},{"id":418,"depth":15,"text":421},{"id":473,"depth":15,"text":476},{"path":676,"title":677,"description":678},"\u002Fintegrations\u002Feslint","ESLint","Lint JavaScript, TypeScript, Vue templates, YAML locales, comments and identifiers against your glosslint corpus with ESLint flat config.",{"path":680,"title":681,"description":682},"\u002Fintegrations\u002Fcli","Command line","Run glosslint from the terminal to check Markdown and MDX docs, test corpus examples, print a glossary, and explain terms.",1795627930536,"94d466e2-147b-430f-b5f0-25c6a986e462"]