Note that there are some explanatory texts on larger screens.

plurals
  1. POZend framework, gettext, poedit and human language in which key strings are written
    primarykey
    data
    text
    <p>I'm writing a website using ZendFramework and decided to use the gettext system to internationalize its content. In my views I write string in french and provide a this moment only one file "en.mo" to translate sentences to english. I would like to avoid to maintain a file "fr.mo" which would only translate a sentence to the exact same sentence.</p> <p>Is there a way to tell Zend or gettext that when the locale is "fr" or "fr_FR" then there is no need to search for a translation file and the key string must be just returned as is ? Or maybe there is a reason to create the "identity translation" file fr.mo ?</p> <p>Key-quotes of my code at this point :</p> <p>Extract of my bootstrap:</p> <pre> protected function _initTranslations() { $config = $this->getApplication()->getOptions(); Zend_Locale::setDefault('en'); // fallback if detection fails completely $locale = new Zend_Locale(); if ( !in_array($locale->getLanguage(), explode(',',$config['available_translations']))) { $locale->setLocale('en'); // requested language is not available => use english } $translate = new Zend_Translate(array( 'adapter' => 'gettext', 'content' => APPLICATION_PATH.'/../languages/gda-'.$locale->getLanguage().'.mo', 'locale' => $locale)); $translate->setLocale($locale); $this->bootstrap('view'); $this->getResource('view')->getHelper('translate')->setTranslator($translate); } </pre> <p>content of /languages/ :</p> <pre> gda-en.mo gda-fr.mo &lt;== this one I would like to avoid maintaining </pre> <p>thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload