CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-formatjs--intl-localematcher

Intl.LocaleMatcher ponyfill providing comprehensive locale matching algorithms with support for 'lookup' and 'best fit' strategies

94

1.09x
Overview
Eval results
Files

rubric.jsonevals/scenario-2/

{
  "context": "This criteria evaluates how well the engineer uses the @formatjs/intl-localematcher package to implement locale matching functionality. The focus is on proper usage of the match() function, correct configuration of matching algorithms, and appropriate handling of default locales.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import match function",
      "description": "Correctly imports the match() function from @formatjs/intl-localematcher package",
      "max_score": 10
    },
    {
      "name": "Call match function",
      "description": "Uses the match() function as the primary mechanism for locale matching",
      "max_score": 25
    },
    {
      "name": "Pass requested locales",
      "description": "Correctly passes the requestedLocales array as the first parameter to match()",
      "max_score": 10
    },
    {
      "name": "Pass available locales",
      "description": "Correctly passes the availableLocales array as the second parameter to match()",
      "max_score": 10
    },
    {
      "name": "Configure default locale",
      "description": "Properly sets the defaultLocale option in the third parameter to match(), using the value from options.defaultLocale or the default 'en-US'",
      "max_score": 15
    },
    {
      "name": "Configure algorithm option",
      "description": "Properly sets the algorithm option ('lookup' or 'best fit') in the third parameter to match(), using the value from options.algorithm or defaulting to 'best fit'",
      "max_score": 20
    },
    {
      "name": "Handle empty inputs",
      "description": "Handles edge cases where requestedLocales or availableLocales arrays are empty, ensuring match() is called appropriately or returning the default locale",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-formatjs--intl-localematcher

tile.json