weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Clarify two different lookups related to “state”

Open Geeyun-JY3 opened this issue 1 year ago • 3 comments

Describe the problem

There are two different lookups related to “state”: state:TEXT and is:TEXT. It is confusing.

Describe the solution you'd like

Clarify these two different lookups in the documentation.

Describe alternatives you've considered

No response

Screenshots

No response

Additional context

No response

Geeyun-JY3 avatar Aug 08 '22 10:08 Geeyun-JY3

state looks only at state, while is can handle additional lookups.

For example:

  • is:translated is same as state:>=translated
  • is:untranslated is same as state:<translated
  • is:pending is not looking at string state at all

nijel avatar Aug 10 '22 09:08 nijel

https://docs.weblate.org/en/latest/user/search.html#fields

state:TEXT State search (approved, translated, needs-editing, empty, read-only), supports Field operators.

is:TEXT Search for string states (pending, translated, untranslated).

The description of these two fields in the documentation is quite simple and similar. More detailed explanations are needed.

Geeyun-JY3 avatar Aug 15 '22 09:08 Geeyun-JY3

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

github-actions[bot] avatar Aug 15 '22 09:08 github-actions[bot]

Hi, I would like to work on this.

QuocNguyen2412 avatar Sep 23 '22 19:09 QuocNguyen2412

Any contributors are welcome!

nijel avatar Sep 26 '22 07:09 nijel

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

github-actions[bot] avatar Oct 25 '22 09:10 github-actions[bot]

@nijel I still have questions about the is:TEXT lookup.

According to the source code: https://github.com/WeblateOrg/weblate/blob/bda83e3c28f135e88af5b122770bbb146c690059/weblate/utils/search.py#L192-L202

  • is:read-only is same as state:read-only
  • is:approved is same as state:approved
  • is:needs-editing is same as state:needs-editing
  • is:translated is same as state:>=translated
  • is:untranslated is same as state:<translated

I still wonder why the logic of is:read-only, is:approved and is:needs-editing is different from is:translated and is:untranslated.

And why the is:TEXT was created as a lookup different from the state:TEXT in the begining.

Geeyun-JY3 avatar Oct 28 '22 03:10 Geeyun-JY3

It provides additional queries. It's not uncommon to build a query language with more ways to query the same thing – it makes it easier for a user to write the query. For example, GitHub has this as well: https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-open-or-closed-state

nijel avatar Dec 09 '22 13:12 nijel

I still think it is necessary to detail the function of every available is:TEXT lookup in the documentation. Since the logic of the is:TEXT lookup is currently inconsistent (as listed above). https://github.com/WeblateOrg/weblate/commit/59961d62189378ecbc0d809c4a091432f6d09ead#diff-3eb290919f61bddd29299720477d0001574593aa098ddaf1e41011adb8ebfc3aR50 is not enough and the documentation is still unclear.

Geeyun-JY3 avatar Dec 09 '22 16:12 Geeyun-JY3

Okay reopening.

nijel avatar Dec 12 '22 14:12 nijel