CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-i18next-client

tessl install tessl/npm-i18next-client@1.11.0

DEPRECATED client-side JavaScript internationalization library with translation, pluralization, and localization support.

Agent Success

Agent success rate when using this tile

69%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.08x

Baseline

Agent success rate without this tile

64%

task.mdevals/scenario-3/

Multilingual Product Price Display System

Build a product price display system that formats prices and dates according to different locales using an internationalization library.

Requirements

The system should:

  1. Display product prices formatted according to user locale (currency format)
  2. Show product availability dates formatted for different regions
  3. Display relative time information (e.g., "2 days ago", "in 3 hours")
  4. Format large numbers (like product quantities) with locale-appropriate separators

Functionality

Price Formatting

  • Format monetary values with appropriate currency symbols and decimal places based on locale
  • Support at least USD, EUR, and JPY currencies
  • Handle different locales: 'en-US', 'de-DE', 'ja-JP' @test

Date Formatting

  • Format dates in locale-specific formats (e.g., MM/DD/YYYY for US, DD.MM.YYYY for Germany)
  • Display dates for at least three different locales @test

Relative Time Display

  • Show time differences in human-readable format (e.g., "2 hours ago", "in 5 days")
  • Support at least English and German locales for relative time @test

Number Formatting

  • Format large numbers with appropriate thousands separators
  • Support different locales with varying separator conventions @test

Implementation

@generates

API

/**
 * Initialize the product display system with a specific locale
 * @param {string} locale - The locale to use (e.g., 'en-US', 'de-DE', 'ja-JP')
 * @returns {Promise<void>}
 */
async function initializeDisplay(locale);

/**
 * Format a price with currency for the current locale
 * @param {number} amount - The price amount
 * @param {string} currency - Currency code (e.g., 'USD', 'EUR', 'JPY')
 * @returns {string} Formatted price string
 */
function formatPrice(amount, currency);

/**
 * Format a date for the current locale
 * @param {Date} date - The date to format
 * @returns {string} Formatted date string
 */
function formatDate(date);

/**
 * Format relative time (e.g., "2 days ago")
 * @param {Date} date - The date to compare to now
 * @returns {string} Relative time string
 */
function formatRelativeTime(date);

/**
 * Format a large number with locale-appropriate separators
 * @param {number} value - The number to format
 * @returns {string} Formatted number string
 */
function formatNumber(value);

Dependencies { .dependencies }

i18next { .dependency }

Provides internationalization and localization support with built-in formatting capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/i18next-client@1.11.x
tile.json