Can't get other languages

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Can't get other languages

Post by quepasa »

I can't seem to get the non-English languages to work. I'm interested in Spanish.

If I go to preferences and change to Spanish, the only Spanish I was able to see is within the list of languages in preferences (Inglés instead of English.). I also tried logging in with Spanish as the language, but with no success. Same seems to be true for French and German.

What parts of TimeTrex should be changing to Spanish?

Thank you,

-Ben
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

All English text should change to Spanish. However your operating system needs to support the Spanish locale for it to work.

Please enable debugging mode, with debug_display set to TRUE and debug verbosity set to 10. Login to TimeTrex and copy and paste the debug output at the bottom of the Home page here.

That should tell us what is going on.
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

Paste from debug is below. I only pasted the top part that had the error. If you need more info let me know and I'll paste the rest.
However your operating system needs to support the Spanish locale for it to work.
This is probably the problem. The server is Windows XP Pro SP2. What do I do to make XP support the Spanish locale (see signature for other server info)?

Thanks,

-Ben

Code: Select all

Debug Buffer
============================================================================
Memory Usage: 9233528
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /timetrex/interface/index.php
DEBUG [202]: [Function](): Production: 0
DEBUG [491]: Authentication::Check(): Session Name: SessionID
DEBUG [497]: Authentication::Check(): Session ID: 871a0896b8245d22de4e30573ee2d06b
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:871a0896b8245d22de4e30573ee2d06b
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:871a0896b8245d22de4e30573ee2d06b
DEBUG [64]: [Function](): User Authenticated: lcastro Created Date: 1183072824
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete: 
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: US/Eastern
DEBUG [129]: TTDate::setDateFormat(): Setting Default Date Format: d/m/Y
DEBUG [143]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [157]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [95]: [Function](): Locale Cookie: 
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: 
DEBUG [97]: [Function](): Changing User Preference Language to match cookie...
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: 
DEBUG [94]: Validator::inArrayKey(): Key: 
DEBUG [406]: Validator::Error(): Validation Error: Label: language Msg: Incorrect language
DEBUG [728]: Factory::isValid(): Calling Validate()
DEBUG [385] Array: Validator::isValid(): Errors 
Array
(
    [language] => Array
        (
            [0] => Incorrect language
        )

)


DEBUG [192]: TTi18n::generateLocale(): Failed Setting Locale... Falling Back to: en_US!
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 0 Current Locale: 
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [286]: TTi18n::setLocale(): Failed setting translator locale: en_US
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete: 
DEBUG [1094]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

DEBUG [95]: [Function](): Locale Cookie:
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale:
DEBUG [97]: [Function](): Changing User Preference Language to match cookie...
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale:
DEBUG [94]: Validator::inArrayKey(): Key:
DEBUG [406]: Validator::Error(): Validation Error: Label: language Msg: Incorrect language
DEBUG [728]: Factory::isValid(): Calling Validate()
DEBUG [385] Array: Validator::isValid(): Errors
Array
(
[language] => Array
(
[0] => Incorrect language
)

)


DEBUG [192]: TTi18n::generateLocale(): Failed Setting Locale... Falling Back to: en_US!
Something else is the matter there. For some reason TimeTrex is trying to set the language to a blank value, which is of course invalid so its falling back to English.

Is it possible for you to change the language in your Employee Preferences area, then clear your cookies and login again to see if that helps?
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

Is it possible for you to change the language in your Employee Preferences area, then clear your cookies and login again to see if that helps?
I changed the language back to English, logged out, cleared Cookies, History and all temporary internet files. Logged back in asking for English, and the same exact error still occurs.

By the way, I have tried this on more than one computer, using IE6 and Firefox 2.0.0.1 and they all have the same error.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you edit your includes/Interface.inc.php file, and change this line:

Code: Select all

		Debug::text('Locale Cookie: '. TTi18n::getLocaleCookie() , __FILE__, __LINE__, __METHOD__, 10);
		if ( $current_user_prefs->getLanguage() !== TTi18n::getLanguageFromLocale( TTi18n::getLocaleCookie() ) ) {

to:

Code: Select all

		Debug::text('Locale Cookie: '. TTi18n::getLocaleCookie() , __FILE__, __LINE__, __METHOD__, 10);
		if ( TTi18n::getLocaleCookie() != '' AND $current_user_prefs->getLanguage() !== TTi18n::getLanguageFromLocale( TTi18n::getLocaleCookie() ) ) {
See if that helps.

For some reason your language cookie is being set to a null value when you login I think, and thats causing issues.
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

I made the changes. However, still no Spanish. Cleared cookies, and temp internet files.

Here is what the first part of debug has to say:
Debug Buffer
============================================================================
Memory Usage: 9192520
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /timetrex/interface/index.php
DEBUG [202]: [Function](): Production: 0
DEBUG [491]: Authentication::Check(): Session Name: SessionID
DEBUG [497]: Authentication::Check(): Session ID: 65340dd241cec780b841f5e65cc2d0fe
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:65340dd241cec780b841f5e65cc2d0fe
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:65340dd241cec780b841f5e65cc2d0fe
DEBUG [64]: [Function](): User Authenticated: lcastro Created Date: 1183150262
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: US/Eastern
DEBUG [129]: TTDate::setDateFormat(): Setting Default Date Format: d/m/Y
DEBUG [143]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [157]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [97]: [Function](): Locale Cookie:
DEBUG [105]: [Function](): User Preference Language matches cookie!
DEBUG [192]: TTi18n::generateLocale(): Failed Setting Locale... Falling Back to: en_US!
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 0 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [286]: TTi18n::setLocale(): Failed setting translator locale: en_US
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [1094]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
DEBUG [133]: [Function](): Station ID Cookie found! 638670a7f14093b3ade72a5bf14c5c41
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you edit your classes/modules/core/TTi18n.class.php file, and about 10-15 lines from the bottom change:

Code: Select all

$rc = setlocale( LC_MESSAGES, $locale );
to:

Code: Select all

$rc = $locale
See if that works for you.
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

Hmmm. Still not working. Now, if I change my preference to Spanish, the drop down menu remains in English (instead of saying Español, Ingles, etc). The good news is if I logout, it takes me to a Spanish login page! However, once I log back in everything is in English, and the setting for Langauage Preference has reverted itself back to "English". Here are the steps I've taken (both as a user and as admin) as well as debug from the crucial steps:

1. Set Language to English.
2. Logout
3. Delete Cookies
4. Login
5. Set Language to "Spanish" (Nothing in spanish, not even in the language preference drop down list.)
6. Logout
7. Login Page is now in Spanish!
8. Delete Cookies (have also tried skipping this step to see what happens, but outcome does not change)
9. Login
10. Everything is in English!
11. Language Preference says "English"!



Debug when saving language preference (step 5):
Debug Buffer
============================================================================
Memory Usage: 8408840
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /timetrex/interface//users/EditUserPreference.php?user_id=2&data_saved=1
DEBUG [202]: [Function](): Production: 0
DEBUG [491]: Authentication::Check(): Session Name: SessionID
DEBUG [497]: Authentication::Check(): Session ID: 3cc5274b03a4de24a89258af9cfc6351
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:3cc5274b03a4de24a89258af9cfc6351
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:3cc5274b03a4de24a89258af9cfc6351
DEBUG [64]: [Function](): User Authenticated: lcastro Created Date: 1183390443
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: US/Eastern
DEBUG [129]: TTDate::setDateFormat(): Setting Default Date Format: d/m/Y
DEBUG [143]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [157]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [97]: [Function](): Locale Cookie: es_US
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: es_US
DEBUG [105]: [Function](): User Preference Language matches cookie!
DEBUG [192]: TTi18n::generateLocale(): Failed Setting Locale... Falling Back to: en_US!
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 0 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [302]: TTi18n::setLocale(): Set Locale To: en_US
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [1094]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
DEBUG [133]: [Function](): Station ID Cookie found! c982f76a7040107496350e713ced5746
DEBUG [240]: [Function](): UnRead Messages: 0
DEBUG [268]: [Function](): Exception Flag to Display: red
DEBUG [429]: HierarchyListFactory::getHierarchyChildrenByCompanyIdAndUserIdAndObjectTypeID(): Hierarchy Control ID: 1
DEBUG [48]: BreadCrumb::setCrumb(): Dropping Bread Crumb: Employee Preferences URL: /timetrex/interface//users/EditUserPreference.php?user_id=2&data_saved=1
============================================================================

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 98.6142 ms (12.28 %) Authentication::Check()
1 59.9391 ms (7.46 %) Interface.inc - Check for Exceptions
1 65.1391 ms (8.11 %) Interface.inc - Check for UNREAD messages...
1 4.2441 ms (0.53 %) getEmptyRecordSet()
1 41.4112 ms (5.16 %) getPermissionHierarchyChildrenByCompanyIdAndUserId
1 388.4442 ms (48.36 %) unprofiled

145.4322 ms (18.11 %) Missed
============================================================================
803.2241 ms (100.00 %) OVERALL TIME
============================================================================
Debug when logging out (step 6)
Debug Buffer
============================================================================
Memory Usage: 3506344
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /timetrex/interface/Login.php
DEBUG [202]: [Function](): Production: 0
DEBUG [50]: [Function](): Bypassing Authentication
DEBUG [345]: TTi18n::chooseBestLocale(): Choosing Best Locale...
DEBUG [362]: TTi18n::chooseBestLocale(): Using Language from cookie: es_US
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: es_US Category: 0 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: es_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: es_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: es_ES
DEBUG [302]: TTi18n::setLocale(): Set Locale To: es_US
DEBUG [407]: TTi18n::chooseBestLocale(): Using Locale: es_US
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: es_US
============================================================================

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 0.0000 ms (0.00 %) unprofiled

229.1720 ms (100.00 %) Missed
============================================================================
229.1720 ms (100.00 %) OVERALL TIME
============================================================================
Partial Debug when logging back in (step 9)
Debug Buffer
============================================================================
Memory Usage: 9264368
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /timetrex/interface/index.php
DEBUG [202]: [Function](): Production: 0
DEBUG [491]: Authentication::Check(): Session Name: SessionID
DEBUG [497]: Authentication::Check(): Session ID: 8f2670e4bf295cb08213c2eeebef59c1
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:8f2670e4bf295cb08213c2eeebef59c1
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:8f2670e4bf295cb08213c2eeebef59c1
DEBUG [64]: [Function](): User Authenticated: lcastro Created Date: 1183391080
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: US/Eastern
DEBUG [129]: TTDate::setDateFormat(): Setting Default Date Format: d/m/Y
DEBUG [143]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [157]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [97]: [Function](): Locale Cookie: en_US
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: en_US
DEBUG [99]: [Function](): Changing User Preference Language to match cookie...
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale: en_US
DEBUG [94]: Validator::inArrayKey(): Key: en
DEBUG [728]: Factory::isValid(): Calling Validate()
DEBUG [711]: Factory::StartTransaction(): StartTransaction(): Transaction Count: 0 Trans Off: 0
DEBUG [728]: Factory::isValid(): Calling Validate()
DEBUG [800]: Factory::Save(): Updating...
DEBUG [625]: Factory::getUpdateQuery(): Update
DEBUG [257]: Validator::isDate(): Raw Date: 1183391080 Converted Value: 1183391080
DEBUG [656]: Factory::getUpdateQuery(): Data changed, set updated date:
DEBUG [106]: Validator::isNumeric(): Value:2
DEBUG [94]: Validator::inArrayKey(): Key: 20
DEBUG [145]: Validator::isLength(): Value: user_preference Length: 15 Min: 2 Max: 250
DEBUG [145]: Validator::isLength(): Value: Employee Preferences Length: 20 Min: 2 Max: 2000
DEBUG [711]: Factory::StartTransaction(): StartTransaction(): Transaction Count: 1 Trans Off: 1
DEBUG [757]: Factory::Save(): Calling preSave()
DEBUG [257]: Validator::isDate(): Raw Date: 1183391080 Converted Value: 1183391080
DEBUG [787]: Factory::Save(): Insert ID: 1103
DEBUG [693]: Factory::getInsertQuery(): Insert
DEBUG [721]: Factory::CommitTransaction(): CommitTransaction(): Transaction Count: 1 Trans Off: 2
DEBUG [838]: Factory::Save(): Calling postSave()
DEBUG [65]: Factory::removeCache(): Attempting to remove cache: 2
DEBUG [68]: Factory::removeCache(): Removing cache: 2
DEBUG [721]: Factory::CommitTransaction(): CommitTransaction(): Transaction Count: 1 Trans Off: 1
DEBUG [192]: TTi18n::generateLocale(): Failed Setting Locale... Falling Back to: en_US!
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 0 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [302]: TTi18n::setLocale(): Set Locale To: en_US
DEBUG [1690]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [1094]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
********SNIP*************
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Is it possible for you to give us access to your server so we can login and diagnose what is causing this?

If so, please email all the information (IP address, login/password) to support@timetrex.com.
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

Is it possible for you to give us access to your server so we can login and diagnose what is causing this?
Sorry, but I have been using my workstation to try out the program and I don't want to allow outside access to this computer.

I am going to install this on a Windows 2000 Server shortly. TimeTrex will be the only thing on the server (at least for the time being), so if I continue to have problems I don't see any reason why i can't put the computer in our DMZ and send you the details for gaining access to it.

Thanks,
-Ben
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

We just released TimeTrex v2.0.2, give that a try, it may work better for you.
quepasa
Posts: 58
Joined: Thu Jun 21, 2007 11:16 am

Post by quepasa »

We just released TimeTrex v2.0.2, give that a try, it may work better for you.
Yup, that did the trick. Thanks.
viquez
Posts: 2
Joined: Fri Jan 11, 2008 9:43 am

Post by viquez »

Same problem...

Server: Ubuntu Desktop Ed 7.10 in Spanish
TimeTrex version 2.1.3
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Try upgrading to v2.2.0, released yesterday.
viquez
Posts: 2
Joined: Fri Jan 11, 2008 9:43 am

Post by viquez »

I upgrade to the latest version [2.2.6], but still the problem...
Locked