SolidOS / solidos

The operating system for Solid
https://solidos.solidcommunity.net/
MIT License
127 stars 19 forks source link

Several bugs in solidcommunity.net UI with language entries in one's pod #42

Closed mariadimou closed 2 years ago

mariadimou commented 3 years ago

Hello!

While adding Languages (WebID is https://dimou.solidcommunity.net/profile/card#me) I see text: "Add one or more knows Language". If it means "Add one or more known Languages", please fix the typo. It puts off newcomers to Solid!

I also want to add "russian", it only accepts "russu". What is this?!?! image

The same with "french". It gives me "Lenga haitian creole french" and something more exotic, no way to enter the french spoken in France...

Please fix this. Grateful Maria Dimou

ewingson commented 3 years ago

to a) (the typo) ... finding the part of the code that shows that message should be no problem.

to b) I think it is because the language is shown in that specific language. so english , francais or deutsch .

mariadimou commented 3 years ago

Lieber Matthias, ich danke Dir fuer Deine schnelle Antwort.

I think the explanation to 'b' is brilliant, still unacceptable. I trust there must be a way en français to say "Lenga haitian creole french", still this bogus description is offered in english.

Moreover, WHY "Modern Greek" works and is not presented, by the same algorithm as Ελληνικά?

Whatever the explanation I doubt I am the only multi-lingual and puzzled Solid pod owner.

Thanks again for considering my proposal to fix this. Yours Maria

timbl commented 3 years ago

The typo is in fact more complicated, as the prompt is built up automatically from the label on the predicate, in the ontology, which i this case says "knows language". So just adding a label with priority (like ui:label) to the schema or the form metadata "known language" or for that matter just "language" should fix that problem.

The language selection problems you have are more complicated. I can't see from the screen shot clearly what you are being offered. Looking at your profile I see it has three competing versions of your language preferences, where each list contains the language Modern Greek. Maybe it is trying to offer you choices of other languages in greek. Can you show what options you are getting? Maybe they are being displayed in greek, but the browser don't have greek fonts or something.

:id1629201755476 solid:publicId l:el.
[...]
:me
    a schema:Person, foaf:Person;
    schema:knowsLanguage
        ( :id1629201755476 :id1629201806315 :id1629201830484 ),
        ( :id1629201755476 ), 
        ( :id1629201755476 :id1629201806315 );
mariadimou commented 3 years ago

Screenshot from 2021-08-17 14-08-34

Sorry my screenshot was ridiculously small.

mariadimou commented 3 years ago

Grateful to @timbl for the explanations.

Here comes another screenshot about the french. I tried to type français as @ewingson suggested. See what happens:

Screenshot from 2021-08-19 18-12-35

mariadimou commented 3 years ago

Tutlayt Tafransist is what comes up when I type français. Before I finish the string Tutlayt... comes up and can't be overriden.

The browser has greek characters. See screenshot in the next comment.

Thanks again!

mariadimou commented 3 years ago

to test the above I tried to enter Ελληνικά. Contrary to français case above, this was accepted and overriden by what you see below. It means Modern Greek (so it doesn't complain if a language is entered more than once, in various languages. :-)

Screenshot from 2021-08-19 18-18-28

timbl commented 3 years ago

The language selection is done sending the strings you type to Wikidata at the bottom of the profile form https://github.com/solid/solid-panes/blob/main/src/profile/profileFormText.ttl#L359

timbl commented 3 years ago

so anything you type in any language is sent of to see if it matches any language code label in any language. The language code itself, not the label, is currently stored in your pod. Yes, there is no check you don't have two the same. Strange that typing "french" did not give you "French". Maybe something to do with post-filtering the results for things in your language.

timbl commented 3 years ago

Hmmmm... console trace from reproducing the situation:

image

aka

Setting lock at "fre"
mashlib.min.js:172 getPreferredLanguages: No publiID of language.
(anonymous) @ mashlib.min.js:172
mashlib.min.js:172      User knows languages with codes: "el,el"
mashlib.min.js:1 Setting lock at "fren"
mashlib.min.js:172 getPreferredLanguages: No publiID of language.
(anonymous) @ mashlib.min.js:172
mashlib.min.js:172      User knows languages with codes: "el,el"
mashlib.min.js:1    Querying database at "fren" cf last "undefined".
mashlib.min.js:172 getPreferredLanguages: No publiID of language.
(anonymous) @ mashlib.min.js:172
mashlib.min.js:172      User knows languages with codes: "el,el"
mashlib.min.js:1 Querying public data - sparql: SELECT ?item ?subject ?name
WHERE
{ ?item wdt:P305 ?subject .
  OPTIONAL {?item rdfs:label ?name}
  OPTIONAL {?item wdt:P1705 ?name}
  FILTER regex(?name, "fren", "i")
  FILTER regex(?subject, "^..$", "i")
}
mashlib.min.js:1  queryPublicDataSelect uri: https://query.wikidata.org/sparql?query=SELECT+%3Fitem+%3Fsubject+%3Fname%0AWHERE%0A%7B+%3Fitem+wdt%3AP305+%3Fsubject+.%0A++OPTIONAL+%7B%3Fitem+rdfs%3Alabel+%3Fname%7D%0A++OPTIONAL+%7B%3Fitem+wdt%3AP1705+%3Fname%7D%0A++FILTER+regex%28%3Fname%2C+%22fren%22%2C+%22i%22%29%0A++FILTER+regex%28%3Fsubject%2C+%22%5E..%24%22%2C+%22i%22%29%0A%7D
mashlib.min.js:1 Ignoring "frenc" because of lock 
mashlib.min.js:1     Query result JSON{
    "head": {
        "vars": [
            "item",
            "subject",
            "name"
    ...
mashlib.min.js:1  Filter by language: 15 -> 2
mashlib.min.js:1  Filter:"fren" lastBindings: 2, slimmed to 2; rows: 2, Enough? true, All displayed? true
timbl commented 3 years ago

Query results re-running the wikidata query:

{"head":{"vars":["item","subject","name"]},"results":{"bindings":[{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"en","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"en-ca","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},

  "name":{"xml:lang":"en-gb","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},

  "name":{"xml:lang":"sco","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},

  "name":{"xml:lang":"jam","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},

  "name":{"xml:lang":"pih","type":"literal","value":"French"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},

  "name":{"xml:lang":"ang","type":"literal","value":"Frenċisċ sprǣc"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"crh","type":"literal","value":"Frenk tili"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"crh-latn","type":"literal","value":"Frenk tili"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"st","type":"literal","value":"Se-french"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"tpi","type":"literal","value":"Tok Frens"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"xh","type":"literal","value":"Ulwimi lwasiFrentshi"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"hif","type":"literal","value":"French bhasa"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q150"},"subject":{"type":"literal","value":"fr"},
  "name":{"xml:lang":"kw","type":"literal","value":"Frenkek"}},{"item":{"type":"uri","value":"http://www.wikidata.org/entity/Q33491"},"subject":{"type":"literal","value":"ht"},
  "name":{"xml:lang":"pms","type":"literal","value":"Lenga haitian creole french"}}]}}
timbl commented 3 years ago

So.. when you typed "fren" it narrowed it to two languages, 14 labels for French (Q150 ) in different languages, and one label in one language for Haitian Creole (Q33491). Of the many for French, it looked for one in Greek but there was greek label for the French language. So it picked randomly - and do you got the label for french in Xhosa! Hence your puzzlement at "Ulwimi lwasiFrentshi" as clearly your Xhosa is not up to level of your other languages! This is why it is so valuable to have real users! As a fix, a simple thing do do might be to temporarily append "en, fr, de, ar, cn" say to the list of preferred languages which is passed into the function, being admittedly western-centric with the order. That would be for general multi-lingual queries from somewhere like Wikidata. But for the case of a name for a language itself, we should probably prioritize the language itself of course, so you wold have got "Français" if you had typed "fran" instead of "fren".

mariadimou commented 3 years ago

Thanks again @timbl.

Maybe present the pod owner with a drop down menu to select from, where all exotic languages can be present, including the ones most people know.

In this way one doesn't wonder now whether to write french or français.

mariadimou commented 3 years ago

Btw,

the Νέα ελληνική γλώσσα of yesterday was replaced by Modern Greek overnight (it wasn't me).

German gives fantastic varieties of germanic(?) dialects and Yiddish (maybe), wherelse the orthodox Deutsch is simply not accepted.

Please see screenshot:

Screenshot from 2021-08-20 11-39-40

mariadimou commented 2 years ago

Recording for the record due to difficulty to navigate inside a busy gitter channel:

Discussing this again with @timbl and @jeff-zucker starting with gitter post https://gitter.im/solid/solidos?at=61f159209a335454064067d6

timea-solid commented 2 years ago

This should be fixed now.