// Load the translation file $ini = eZINI::instance( 'greetings.ini' ); $translations = $ini->group( 'Translation' ); // Print the translated string echo ezpI18n::tr( 'greetings', 'Hello, world!', null, null, null, $translations );
// Load the translation file $ini = eZINI::instance( 'greetings.ini' ); $translations = $ini->group( 'Translation' ); // Translate a string with variable replacement $name = 'John'; $greeting = ezpI18n::tr( 'greetings', 'Hello, %name%! How are you today?', null, null, array( '%name%' => $name ), $translations ); // Print the translated string echo $greeting;This example demonstrates how to use variable replacement in translated strings using the ezpI18n::tr() function. Package Library: The ezpI18n tr class is a part of the eZ Publish framework, which is a content management system and web application platform written in PHP. It provides a wide range of features and functionality for building complex web applications, including content management, e-commerce, and community features.