tessl install tessl/npm-i18next-client@1.11.0DEPRECATED 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%
Build a custom logger plugin for an internationalization system that tracks translation lookups and missing keys for debugging purposes.
Create a translation system that:
The logger should maintain separate lists for successful lookups and missing keys, allowing developers to identify translation gaps during development.
@generates
/**
* Custom logger plugin for i18next that tracks translation events
*/
class TranslationLogger {
/**
* Creates a new translation logger instance
*/
constructor();
/**
* Gets the plugin type identifier
* @returns {string} The type of plugin ('logger')
*/
get type();
/**
* Initializes the logger with i18next services
* @param {object} services - i18next services object
* @param {object} options - Logger options
*/
init(services, options);
/**
* Logs general messages
* @param {...any} args - Arguments to log
*/
log(...args);
/**
* Logs warning messages
* @param {...any} args - Arguments to log
*/
warn(...args);
/**
* Logs error messages
* @param {...any} args - Arguments to log
*/
error(...args);
/**
* Gets all successful translation lookups
* @returns {Array<{key: string, namespace: string, language: string}>} Array of lookup records
*/
getSuccessfulLookups();
/**
* Gets all missing translation keys
* @returns {Array<{key: string, namespace: string, language: string}>} Array of missing keys
*/
getMissingKeys();
/**
* Clears all logged events
*/
clear();
}
/**
* Initializes i18next with the custom logger and sample translations
* @param {TranslationLogger} logger - The custom logger instance
* @returns {Promise<object>} Initialized i18next instance
*/
async function initializeI18n(logger);
module.exports = {
TranslationLogger,
initializeI18n
};Provides internationalization framework with plugin support.