Making WordPress.org

Opened 2 years ago

Closed 2 years ago

#5966 closed enhancement (fixed)

Give a message when string is too short or wrong in the consistency tool

Reported by: nekojonez's profile NekoJonez Owned by: ocean90's profile ocean90
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords: has-patch needs-testing
Cc:

Description

Today I was working on cleaning up old translations and I noticed that for this string:
https://translate.wordpress.org/projects/wp-plugins/erp/stable/nl/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=12800889&filters%5Btranslation_id%5D=89776558

There were strange other translations in the translation memory, so I went to the consistency tool to check where they came from... But, when I entered the short "0" string, nothing happened.

I think it would be a great QoL feature if there is some sort of message when the string is too short or generates some other error, since now it looks like the page just refreshes and nothing happened.

Attachments (1)

5966.patch (695 bytes) - added by vladytimy 2 years ago.

Download all attachments as: .zip

Change History (4)

#1 @vladytimy
2 years ago

I think this is caused by evaluating 0 string value of $search to falsey on this line, hence it thinks there is no term to perform a search for.

if ( $search && $locale && $set_slug )
   $performed_search = true;

Source file

It's an edge case but maybe the comparsion should be $search !== ''

Last edited 2 years ago by vladytimy (previous) (diff)

@vladytimy
2 years ago

#2 @vladytimy
2 years ago

  • Keywords has-patch needs-testing added

#3 @ocean90
2 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 11345:

Translate, Consistency: Support searching for '0'.

Props vladytimy, ocean90.
Fixes #5966.

Note: See TracTickets for help on using tickets.