View Issue Details

IDProjectCategoryView StatusLast Update
0001280Main CAcert Websiteweb of trustpublic2014-10-21 21:18
Reporteralex Assigned ToBenBE  
PrioritylowSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformMain CAcert WebsiteOSN/AOS Versionstable
Product Version2014 Q2 
Target Version2014 Q3Fixed in Version2014 Q3 
Summary0001280: WOT: Contact Assurer form does not print preferred language
DescriptionContacting an assurer should be in the preferred language of the assurer or in the optionally given additional languages. But the preferred language is not printed and if no additional language is stated the user must guess out which language he should write in which could lead to confusion.
Steps To ReproduceMain menu "CAcert Vertrauensnetzwerk" -> "Einen Assurer finden" -> (locate) -> Then in the list of WoT Assurers use function "E-Mail schreiben" to any participant.

Practically it will turn out a link like https://secure.cacert.org/wot.php?id=9&userid=<number> and the resulting form will contain the line:
"Sprache: <firstname> bevorzugt, auf angeschrieben zu werden."

A given additional language will be printed, though, if exists. But to get in contact may lead to confusion due to not given preferred language.
TagsNo tags attached.
Reviewed byNEOatNHNG, BenBE
Test Instructions

Relationships

related to 0001283 closedegal WoT Contact form shows additional locales double-HTML-encoded 

Activities

felixd

2014-06-10 12:11

updater   ~0004814

Propably caused by old/malfored data:

users data from testserver (vm) contain languages like "de_DE", "en_AU" (column users.language) which do not get resolved to strings properly. (static php array in includes/lib/l10n.php:31). The array expects language codes like "de", "en", ...
I expect such entries to exist on the production server, too. (but i cannot look)

I don't know if such entries still get inserted. If they don't (or shouldn't) a solution would be to fix the database once.
If they are still inserted, or if "locales" instead of languages are wanted, a additional database lookup would be required (table languages)

BenBE

2014-06-11 07:22

updater   ~0004821

Looking at the patch and the surroundings I see some trouble arising. Based on the $locales array in inc/lib/l10n.php we might translate to locales and thus to actual languages, but given we don't have all languages as an translateable string we'll unevitably end up with something like "User prefers being contacted in /العربية/" with the first part being translated into the user's interface language while the latter being in any other language. Although this problem pre-existed even before the patch one might consider to have this information in all user languages available so the string gets properly translated in all cases.

The patch itself contains a minor glitch on zh_CN and zh_TW which would need to be mapped to zh-cn and zh-tw respectively. Inverting the information in the $locales array and falling back to simply truncating if not found there should solve this.

felixd

2014-06-11 15:23

updater   ~0004822

I created a new commit, that uses the $locales array (after making it public), the commit also handles some other cases of which I am not sure, if and how often they appear in the database. (DE, ZH_CN, ZH_TW, .... )

NEOatNHNG

2014-06-21 17:25

administrator   ~0004861

Removed redundant code already present in the L10n class. Refactored the L10n class so that code is usable from outside. Please test & review.

BenBE

2014-06-21 17:51

updater   ~0004863

The last change is legit and reuses the already existing routine for normalization.

felixd

2014-06-24 20:55

updater   ~0004868

Last edited: 2014-06-24 21:24

User with such malformed data existed on the Testsystem with id: 171144 'de_DE'

INOPIAE

2014-06-24 21:18

updater   ~0004869

Last edited: 2014-06-24 21:28

some more id to test 170910 'en_AU'
171036 'en_AU'
171050 'zh_CN'
171051 'pl_PL'

To test go to find assurer. select anyone listed to write to and change the id in the URL.

INOPIAE

2014-06-24 21:29

updater   ~0004870

I tested all 4 ID above and got the selected languages => ok
=> ok

felixd

2014-06-29 11:22

updater   ~0004874

I also tested the 4 IDs above and also got for all of them the desired language.
=> ok

MartinGummi

2014-07-01 21:54

updater   ~0004877

Test IDs
171931 => ok
170910 => ok
171036 => ok
171050 => ok
171051 => ok

I also tested the 4 IDs above and also got for all of them the desired language.
==> ok

wytze

2014-07-16 10:46

developer   ~0004886

The patch has been installed on the production server on July 16, 2014. See also:
https://lists.cacert.org/wws/arc/cacert-systemlog/2014-07/msg00002.html

Issue History

Date Modified Username Field Change
2014-05-14 22:09 alex New Issue
2014-06-10 12:11 felixd Note Added: 0004814
2014-06-10 12:44 felixd Relationship added related to 0001283
2014-06-11 07:22 BenBE Note Added: 0004821
2014-06-11 07:23 BenBE Status new => needs work
2014-06-11 15:23 felixd Note Added: 0004822
2014-06-11 20:51 BenBE Reviewed by => BenBE
2014-06-11 20:51 BenBE Assigned To => NEOatNHNG
2014-06-11 20:51 BenBE Status needs work => needs review & testing
2014-06-11 20:51 BenBE Target Version => 2014 Q2
2014-06-11 20:55 BenBE Source_changeset_attached => cacert-devel testserver-stable a910c6bc
2014-06-11 20:55 felixd Source_changeset_attached => cacert-devel testserver-stable 6b1cd2a5
2014-06-11 20:55 felixd Source_changeset_attached => cacert-devel testserver-stable 0730c9df
2014-06-11 20:55 felixd Source_changeset_attached => cacert-devel testserver-stable f3885b3b
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable 340a1c8a
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable da9630f0
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable 99f5de02
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable 5b192d09
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable 8fdd089f
2014-06-21 17:20 NEOatNHNG Source_changeset_attached => cacert-devel testserver-stable 5118f86c
2014-06-21 17:25 NEOatNHNG Reviewed by BenBE => NEOatNHNG
2014-06-21 17:25 NEOatNHNG Note Added: 0004861
2014-06-21 17:25 NEOatNHNG Assigned To NEOatNHNG => BenBE
2014-06-21 17:51 BenBE Reviewed by NEOatNHNG => NEOatNHNG, BenBE
2014-06-21 17:51 BenBE Note Added: 0004863
2014-06-21 17:51 BenBE Status needs review & testing => needs testing
2014-06-24 20:55 felixd Note Added: 0004868
2014-06-24 21:18 INOPIAE Note Added: 0004869
2014-06-24 21:24 INOPIAE Note Edited: 0004869
2014-06-24 21:24 INOPIAE Note Edited: 0004868
2014-06-24 21:28 INOPIAE Note Edited: 0004869
2014-06-24 21:29 INOPIAE Note Added: 0004870
2014-06-29 11:22 felixd Note Added: 0004874
2014-07-01 21:54 MartinGummi Note Added: 0004877
2014-07-01 21:56 MartinGummi Status needs testing => ready to deploy
2014-07-01 21:56 MartinGummi Target Version 2014 Q2 => 2014 Q3
2014-07-15 19:00 BenBE Source_changeset_attached => cacert-devel release 73abf595
2014-07-16 10:46 wytze Note Added: 0004886
2014-07-16 10:46 wytze Status ready to deploy => solved?
2014-07-16 10:46 wytze Fixed in Version => 2014 Q3
2014-07-16 10:46 wytze Resolution open => fixed
2014-10-21 21:18 INOPIAE Status solved? => closed