Intl.LocaleMatcher ponyfill providing comprehensive locale matching algorithms with support for 'lookup' and 'best fit' strategies
94
{
"context": "This evaluation assesses how well the engineer uses @formatjs/intl-localematcher to implement region-aware locale matching. The focus is on proper usage of the package's matching capabilities, particularly the 'best fit' algorithm that leverages CLDR region containment data.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Imports match function",
"description": "Correctly imports the 'match' function from @formatjs/intl-localematcher package",
"max_score": 15
},
{
"name": "Uses match function",
"description": "Uses the 'match' function to perform locale matching with the correct parameters (requestedLocales, availableLocales, defaultLocale)",
"max_score": 25
},
{
"name": "Best fit algorithm",
"description": "Leverages the 'best fit' algorithm (either by default or explicitly via options parameter) which enables region-aware matching using CLDR data",
"max_score": 30
},
{
"name": "Correct parameter order",
"description": "Passes parameters to match function in the correct order: user preferences first (requested locales), available locales second, default locale third",
"max_score": 15
},
{
"name": "Handles test scenarios",
"description": "Implementation correctly handles all test scenarios for regional matching (zh-HK to zh-Hant, zh-CN to zh-Hans, en-GB matching, es-MX matching)",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-formatjs--intl-localematcherdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10