You are here: Foswiki>Tasks Web>Item2272 (09 Jan 2015, GeorgeClark)Edit Attach

Item2272: Can't change language in Foswiki-1.0.6-0-strawberry

pencil
Priority: Normal
Current State: No Action Required
Released In: 1.0.9
Target Release: patch
Applies To: Engine
Component: I18N, PlatformWindows
Branches:
Reported By: RalfKrueger
Waiting For:
Last Change By: GeorgeClark
As we use FOSWIKI as corporate wiki, I want to change my private wiki from DokuWiki to FOSWIKI. So I was glad to find Foswiki-1.0.6-0-strawberry.exe for my windows-machine. Installing was easy, but when I try to change the language of this installation I get some problems:

I call configure and change this option:
1 configuration item was changed
{UserInterfaceInternationalisation}

After typing password I get the following message:
Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.
Can't call method "language" on unblessed reference

Then I try to use less languages and switch only
{Languages}{de}{Enabled}
{Languages}{es}{Enabled}

After that I get the following mesage:
Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.
Can't locate Foswikipath in @INC (@INC contains: C:path . C:path C:path C:path C:path-x86-multi-thread C:path C:path)

FOSWIKI can be used, but I get only english in the language selector.

-- RalfKrueger - 19 Oct 2009

I just installed the strawberry based installation and am able to reproduce both error messages. To see the first, simply select all foreign languages. If you add a bless $this; in front of line 184 in Foswiki/I18N.pm, you'll get the second one. Looking in the Foswiki log, it reads:

Can't locate Foswiki/I18N/en_us.pm in @INC (@INC contains: C:/Program Files/Foswiki/Foswiki/lib . C:/strawberry/perl/lib C:/strawberry/perl/site/lib C:/Program Files/Foswiki/Foswiki/lib/CPA/lib//arch C:/Program Files/Foswiki/Foswiki/lib/CPAN/lib//5.10.0/MSWin32-x86-multi-thread C:/Program Files/Foswiki/Foswiki/lib/CPAN/lib//5.10.0 C:/Program Files/Foswiki/Foswiki/lib/CPAN/lib/) at (eval 91) line 3.

This puzzles me, however, since I've never heard of a module called en_us.pm

-- MarkusUeberall - 01 Dec 2009

Ok, found out the bug. It's very simple. In the LocalSite.cfg shipped with the installer, there is this line:
$Foswiki::cfg{Languages}{jp}{Enabled} = 1;
And Japanese has been renamed ja, not jp. Problem here is that the code sees this language as enabled, and therefore tries to add it. As Locale::Maketext::Lexicon is pretty complex, and it's in a BEGIN block, the error is weird. Looking for a module called en_us.pm is the default behavior of Locale::Maketext, and Locale::Maketext::Lexicon should normally make this module available through some heritage loop. As the language file is not there (of course, it's called jp not ja now), it fails.

The proper long-term fix is to fix the code so it's more clever and actually tests that the language file is present before adding it, and warns the user if it's not. The short term fix is to edit your ...\Program Files\Foswiki\Foswiki\lib\LocalSite.cfg and remove the line above.

Created Foswikitask:2499 to fix the core bug, and leaving this one for Sven to fix the installer.

-- OlivierRaginel - 11 Dec 2009

After deleting the line it's a litte bit better: The error-messages are gone, but furthermore there is only english in the language selector and no other languages.

-- RalfKrueger - 11 Dec 2009

This installer is ancient, 5 years since last feedback. Closing this task as no action. There have been several releases since this.

-- GeorgeClark - 09 Jan 2015

ItemTemplate edit

Summary Can't change language in Foswiki-1.0.6-0-strawberry
ReportedBy RalfKrueger
Codebase 1.0.6
SVN Range
AppliesTo Engine
Component I18N, PlatformWindows
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease patch
ReleasedIn 1.0.9
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r7 - 09 Jan 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy