Web based family history software

This Help forum is for issues relates to the latest release (1.6.x). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here.

Question Don't remove en_US.mo from languages folder

  • exxamalte
  • Topic Author
  • Visitor
  • Visitor
8 years 8 months ago #1 by exxamalte
Just a little thing I observed:
If you remove en_US.mo from the languages folder, and a website visitor comes to your site to the very first time with a web browser that only has a language/locale defined which cannot be mapped to any of the remaining languages in your webtrees installation, then the website visitor will see a blank page.
So, don't remove en_US.mo!

Details:
When you for example configure your web browser to "German/Germany", the web browser sends a locale "de-DE" to the web server, and webtrees will try to match that against any existing localisations. And because there is no corresponding de_DE.mo localisation available, webtrees will fall back to its default en_US. Now, if you deliberately removed that language file, there is nothing to fall back on, and no pages can be rendered. The server logs contains something like the following:
Code:
[Mon Jun 29 17:52:45.351803 2015] [:error] [pid 26318] [client 11.11.11.11:11111] PHP Fatal error: Uncaught exception 'Zend_Translate_Exception' with message 'Error opening translation file '/var/www/yourserver.com/www/language/.mo'.' in /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate/Adapter/Gettext.php:72\n Stack trace:\n #0 /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate/Adapter.php(646): Zend_Translate_Adapter_Gettext->_loadTranslationData('/var/www/yourse...', 'de_DE', Array)\n #1 /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate/Adapter.php(327): Zend_Translate_Adapter->_addTranslationData(Array)\n #2 /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate/Adapter.php(176): Zend_Translate_Adapter->addTranslation(Array)\n #3 /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate.php(140): Zend_Translate_Adapter->__construct(Array)\n #4 /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Trans in /var/www/yourserver.com/www/library/bombayworks/zendframework1/library/Zend/Translate/Adapter/Gettext.php on line 72

The code in library/WT/I18N.php appears to make an attempt to fall back onto a tree's preferred languages, but that does not seem to work, at least not in my case. It eventually just falls back to en_US.

The FAQs should probably warn about this and mention that you have to have at least en_US remaining in your languages, not just any language.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #2 by fisharebest
Replied by fisharebest on topic Don't remove en_US.mo from languages folder
FYI, in webtrees 1.7.0, there is a configuration option to choose which languages are used / displayed.

Therefore it will no longer be necessary to delete unwanted languages.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • exxamalte
  • Topic Author
  • Visitor
  • Visitor
8 years 8 months ago #3 by exxamalte
Replied by exxamalte on topic Don't remove en_US.mo from languages folder
Thanks for the info - that's good news. Looking forward to version 1.7.0 then.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}