addLoader('pofile', new PoFileLoader()); self::$translator->addResource('pofile', ROOT_DIR . "po/{$found_locale}.po", $found_locale); # Fallback: # For Symfony/Translation, empty strings are valid, but in po files, untranslated strings are "". # This means we cannot use the standard $translator->setFallbackLocales() mechanism :( self::$fallbacktranslator = new Translator(DEFAULT_LANGUAGE); self::$fallbacktranslator->addLoader('pofile', new PoFileLoader()); self::$fallbacktranslator->addResource('pofile', ROOT_DIR . "po/" . DEFAULT_LANGUAGE . ".po", DEFAULT_LANGUAGE); } return self::$translator->trans($key) ?: self::$fallbacktranslator->trans($key); } } function __($section, $key) { return __i18n::translate($key); } function __f($section, $key, $args) { $msg = __i18n::translate($key); $args = array_slice(func_get_args(), 2); return vsprintf($msg, $args); } /* Date Format */ $date_format['txt_full'] = __('Date', '%A, %B %e, %Y'); //summary in create_date_poll.php and removal date in choix_(date|autre).php $date_format['txt_short'] = __('Date', '%A %e %B %Y'); // radio title $date_format['txt_day'] = __('Date', '%a %e'); $date_format['txt_date'] = __('Date', '%Y-%m-%d'); $date_format['txt_month_year'] = __('Date', '%B %Y'); $date_format['txt_datetime_short'] = __('Date', '%m/%d/%Y %H:%M'); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { //%e can't be used on Windows platform, use %#d instead foreach ($date_format as $k => $v) { $date_format[$k] = preg_replace('#(?