Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Problems with lists...
 
Notifications
Clear all

Problems with lists of objects

20 Posts
2 Users
0 Reactions
14 K Views
(@jean-luc)
Posts: 73
Active Member
Topic starter
 
[#1861]

I found two problems when working on Projeqtor.

1. In lists of objects (p.e. Users), translatable data appears only with internal value ([profileAdministrator]) instead of the translated value ('administrateur').
Not very sexy…

2. When any changes are made in a module for display, there is conflicts between new values or data in the module and recording in 'columnselector' values.
To avoid wrong display, I delete all lines for the concerned entities, so a new recording is done with good data and values (long life to PhpMyAdmin ! 😉
But it seems that something has not been provided for clean structural changes…


 
Posted : 19 Jun 2014 17H57
(@babynus)
Posts: 14952
Member Admin
 

1. In lists of objects (p.e. Users), translatable data appears only with internal value ([profileAdministrator]) instead of the translated value ('administrateur').
Not very sexy…

It is because "profileAdministrator" is not included in lang.js file.

2. When any changes are made in a module for display, there is conflicts between new values or data in the module and recording in 'columnselector' values.
To avoid wrong display, I delete all lines for the concerned entities, so a new recording is done with good data and values (long life to PhpMyAdmin ! 😉
But it seems that something has not been provided for clean structural changes…

Yes, there is :woohoo:
In the fields selector list, click the "reset" button.


 
Posted : 20 Jun 2014 11H21
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

1. In lists of objects (p.e. Users), translatable data appears only with internal value ([profileAdministrator]) instead of the translated value ('administrateur').
Not very sexy…

It is because "profileAdministrator" is not included in lang.js file.

No, all values ARE in lang.js files. They comes right in the detail section when an element is selected.
The problem is only in the objects list (top part of the screen)

2. When any changes are made in a module for display, there is conflicts between new values or data in the module and recording in 'columnselector' values.
To avoid wrong display, I delete all lines for the concerned entities, so a new recording is done with good data and values (long life to PhpMyAdmin ! 😉
But it seems that something has not been provided for clean structural changes…

Yes, there is :woohoo:
In the fields selector list, click the "reset" button.

Where is that “fields selector list”? Not found on any screen, nor in the documentation…


 
Posted : 20 Jun 2014 13H41
(@babynus)
Posts: 14952
Member Admin
 

The problem is only in the objects list (top part of the screen)

They are translated : exemple, profile in user list is correctly translated.
You muist just correctly define format in $_layout :

${idProfile}

Where is that “fields selector list”? Not found on any screen, nor in the documentation…

Here :


 
Posted : 21 Jun 2014 12H29
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

The problem is only in the objects list (top part of the screen)

They are translated : exemple, profile in user list is correctly translated.
You muist just correctly define format in $_layout :

${idProfile}

But this has only for effect that "profileAdministrator" is replaced by "[profileAdministrator]", not by the language-translated value.
And what for fields having already a formatting, as colorNameFormatter ?

Where is that “fields selector list”? Not found on any screen, nor in the documentation…

Here :

Ah, O.K. Thanks !
I’ll go to bed less dumb, this evening. 😛


 
Posted : 21 Jun 2014 12H56
(@babynus)
Posts: 14952
Member Admin
 

But this has only for effect that "profileAdministrator" is replaced by "[profileAdministrator]", not by the language-translated value.
And what for fields having already a formatting, as colorNameFormatter ?

This is because [profileAdministrator] is not found in lang.js file by the javascript code
So you'll need to clean the browser cache to get the translation. Some times, cleaning the cache is not enough, and you may need to close the browser.
I sometimes had difficulties to retrieve the correct translations on javascript side.
Also concider cleaning "server side" cache.


 
Posted : 21 Jun 2014 13H14
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

Sorry, don’t work, whatever I did (emptying cache, exit from Browser, and until shutdown/restart the computer – I work with local server, so all caches are empty).

Display still looks like this :

However, what for fields having already a formatting, as colorNameFormatter ?


 
Posted : 21 Jun 2014 13H58
(@babynus)
Posts: 14952
Member Admin
 

1) all the countryXxxx must exit in the translation file.
2) the layout must be :

${name}

You cannot have simultaneously colorNameFormatter and translateFormatter (one only)


 
Posted : 21 Jun 2014 14H28
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

1) all the countryXxxx must exit in the translation file.
2) the layout must be :

${name}

But IT IS the layout !!! (only width is different, but pure html parameter).
Whatever I can do, the translation at this level only put the name between brackets – as it was not in lang.js…

You cannot have simultaneously colorNameFormatter and translateFormatter (one only)

Too bad.
Thus I have to create a "colorTranslateNameFormatter" (found the module containing these functions. 😉 )
(possible enhancement for a future version, no ?)


 
Posted : 21 Jun 2014 15H02
(@babynus)
Posts: 14952
Member Admin
 

But IT IS the layout !!! (only width is different, but pure html parameter).
Whatever I can do, the translation at this level only put the name between brackets – as it was not in lang.js…

You have to reset layout (as shown on previous screenshot) to take into account layout change.

hus I have to create a "colorTranslateNameFormatter" (found the module containing these functions. 😉 )
(possible enhancement for a future version, no ?)

Possible.
But I will not spend time on this, as I pesonnaly see no interest to it.
If you code it, please post it so that include change in later version.


 
Posted : 21 Jun 2014 15H30
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

It put a track in the i18n function for values not found.
Correct for some other missing values as "AuditSummary", "mandatory", "indicatordefinitionActualDueDateTime", "indicatordefinitionInitialDueDateTime" or "tickettypeTypeTicketIncident"…
But nothing about expected translations. So :
1. i18n is not called (or called with $i18nMessages set).
2. Implies translateFormatter is not called or with an empty value.

But in second case, from where come the brackets ? So I think $i18nmessages wrongly set.

I continue investigation…


 
Posted : 21 Jun 2014 15H40
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

Problem localized:

When calling function i18n in projeqtor.js, even when i18nMessages loaded, the string to translate is never found!

… but as I’m not fluent with javascript, I am not able to see deeper…
(I don’t know how to display javascript array content)

Edit 22 june : suceeded to return length of array i18nMessages : always "undefined", so no values are returned by function "dojo.i18n.getLocalization".

Can you investigate with these infos?


 
Posted : 21 Jun 2014 16H47
(@babynus)
Posts: 14952
Member Admin
 

Array can be empty at some moments, as it is loaded dynamically.

In the profile screen, do you have some names translated ?


 
Posted : 22 Jun 2014 19H22
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

Array can be empty at some moments, as it is loaded dynamically.

So, for testing, I have enforced the load at each call, and added some suffixes to the returned value to see what comes from.
The functions returns a value, but always null. An empty array would be 0 (zero) length, not "undefined".

In the profile screen, do you have some names translated ?

Via javascript, no one, nowhere !
Only translations with the php module are made (and the some untranslated in that way are really missing).

Edit: tested on external server, connected with Internet Explorer 8: same problem, so Firefox javascript is not responsible.


 
Posted : 22 Jun 2014 20H42
(@babynus)
Posts: 14952
Member Admin
 

So it seems you broke something in the lang.js file that prohibits its loading.
Some special caracters may cause this, or some "not reallu special" ones suche as point or line break.

How did you generate lang.js file ?
Did you use lang.xls ?


 
Posted : 22 Jun 2014 22H51
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

So it seems you broke something in the lang.js file that prohibits its loading.
Some special caracters may cause this, or some "not reallu special" ones suche as point or line break.

No « special characters ». Therefore, nothing is loaded neither for french nor for english, and this one is pure ASCII !
Verified all end-of-line : LR+NL (DOS-Windows) everywhere. Tried NL (Unix), no change.
Found an error due to sort made on the entire file (except first and last lines which are delimiters: the last line (currentLocaleOfFile) was not in alphabetical place, so it was moved to the middle without terminal comma, whereas the new last line (year) kept a comma. But afted correction, still no change.

How did you generate lang.js file ?
Did you use lang.xls ?

Not at this time, only direct update in lang.js files.

But fr/lang.js and en/lang.js (identical to nls/lang.js, a symbolic link would be more appropriate than a duplication… but problematic under Windows, I suppose) have been in-depth checked, I’m sure they are O.K.
However, they are in attachment here (suffixes with ".txt" to be accepted as attachments), so you can verify by yourself..


 
Posted : 23 Jun 2014 10H00
(@babynus)
Posts: 14952
Member Admin
 

No « special characters ». Therefore, nothing is loaded neither for french nor for english, and this one is pure ASCII !
Verified all end-of-line : LR+NL (DOS-Windows) everywhere. Tried NL (Unix), no change.
Found an error due to sort made on the entire file (except first and last lines which are delimiters: the last line (currentLocaleOfFile) was not in alphabetical place, so it was moved to the middle without terminal comma, whereas the new last line (year) kept a comma. But afted correction, still no change.

Can you try and retrieve standard lang.js file and check that profile names are translated in the list (working fine with standard version).
Then add progressively you new tranlation lines, and check progressivemely to find which new line brings the issue.

Not at this time, only direct update in lang.js files.

Advise : use lang.xls file to add new lines and generate lang.js files

But fr/lang.js and en/lang.js (identical to nls/lang.js, a symbolic link would be more appropriate than a duplication… but problematic under Windows, I suppose) have been in-depth checked, I’m sure they are O.K.

As translation works fine woth standard version and not with your own, I'm almost sure issue comes from the new lines.

However, they are in attachment here (suffixes with ".txt" to be accepted as attachments), so you can verify by yourself..

Sorry, but I'll spend no time to analyze your own changes. I would do this only for paid support customers.


 
Posted : 23 Jun 2014 13H19
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

OK, found. ONE key had a hyphen, that javascript didn’t digest!
This implies that javascript, somewhere in the load process, convert these keys to variables, I don’t see why…

Now, all works. 🙂


 
Posted : 23 Jun 2014 16H01
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

Thus I have to create a "colorTranslateNameFormatter" (found the module containing these functions. 😉 )
(possible enhancement for a future version, no ?)

Possible.
But I will not spend time on this, as I pesonnaly see no interest to it.
If you code it, please post it so that include change in later version.

Done, very easy.

Just:
1. duplicate colorNameFormatter in view/js/projeqtorFormatter.js et tool/formatter.php, renaming the copy as colorTranslateNameFormatter;
2. in tool/formatter.php, replace in "return" line with html code "$val" by "i18n($val)";
3. in view/js/projeqtorFormatter.js, replace in "return" line with html code "val" by "i18n(val)".
Now, you can replace in various models «formatter="colorNameFormatter"» with «formatter="colorTranslateNameFormatter"» in translatable colored fields.
It works perfectly. 😛


 
Posted : 23 Jun 2014 16H15
(@babynus)
Posts: 14952
Member Admin
 

Thanks.


 
Posted : 23 Jun 2014 16H21
Share:

Scroll to Top