Skip to content

The search doesn't find anything if use a non-English localization #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Plyha
Copy link
Member

@Plyha Plyha commented Sep 24, 2022

This happens because propepries:advance.user.search.username, advance.user.search.name ,advance.user.search.email must use an English translation string or must not be translated.

If the Brazilian/Russian language was set in Openfire, then the search stopped working.
The Latvian language was not affected by this problem because it is not available in Openfire.

Plyha and others added 2 commits September 24, 2022 15:33
The 'var' values should be hard-coded, and not be in any kind of human-readable/translated state.

Instead, a label should be used for human-readable/translated content.
@guusdk
Copy link
Member

guusdk commented Jul 20, 2023

Apologies for the long, long wait.

I don't believe that your changes fix the underlying problem. For some reason, the code uses a translatable value for the var of each item. That's not correct. Those var values should be hard-coded. If a human-readible translation is desired, then a label can be used.

I've added an untested commit that tries to do this.

@raspopov
Copy link

raspopov commented Aug 24, 2023

Maybe "var" and "label" attributes are mixed up when outputting "field" tags?
Sample XML answer:

<iq type="result" id="H2XHS-311" from="search.foo.com" to="[email protected]/computer">
  <query xmlns="jabber:iq:search">
    <x xmlns="jabber:x:data" type="result">
      <field var="FORM_TYPE" type="hidden"/>
      <reported>
        <field var="jid" type="jid-single" label="JID"/>
        <field var="Username" type="text-single" label="Имя пользователя"/>
        <field var="Name" type="text-single" label="Имя"/>
        <field var="Email" type="text-single" label="Электронная почта"/>
      </reported>
      <item>
        <field var="jid">
          <value>
            [email protected]
          </value>
        </field>
        <field var="Имя пользователя"> ⬅️
          <value>
            user_name
          </value>
        </field>
        <field var="Имя">⬅️
          <value>
            User Name
          </value>
        </field>
        <field var="Электронная почта">⬅️
          <value>
            [email protected]
          </value>
        </field>
      </item>
    </x>
  </query>
</iq>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants