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.
  • Page:
  • 1

TOPIC:

Don't remove en_US.mo from languages folder 5 years 10 months ago #1

  • exxamalte
  • exxamalte's Avatar Topic Author
  • Visitor
  • Visitor
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:
[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.

Don't remove en_US.mo from languages folder 5 years 10 months ago #2

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14491
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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Don't remove en_US.mo from languages folder 5 years 10 months ago #3

  • exxamalte
  • exxamalte's Avatar Topic Author
  • Visitor
  • Visitor
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.

  • Page:
  • 1
Powered by Kunena Forum