Closed Bug 1340971 Opened 3 years ago Closed 5 months ago

Use proper plural form in editor.searchResults and sourceSearch.resultsSummary

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox69 --- fixed

People

(Reporter: flod, Assigned: bmiriam1230)

References

(Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

Problem was raised in https://bugzilla.mozilla.org/show_bug.cgi?id=1331654#c24 but I never filed a bug.

editor.searchResults=%d of %d results

Several languages require a proper plural form based on the second variable.
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Use_proper_plural_forms

There's an additional problem though: plural form expects variables in the form #1, #2, etc.
https://hg.mozilla.org/l10n/compare-locales/file/tip/compare_locales/checks.py#l63
Actually, there's another string in debugger

sourceSearch.resultsSummary=%d instances of “%S”
Summary: Use proper plural form in editor.searchResults → Use proper plural form in editor.searchResults and sourceSearch.resultsSummary
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Product: Firefox → DevTools
Hey, David could you check and see if this is still relevant?
Flags: needinfo?(dwalsh)

:flod Could you provide me the proper strings? I can get them changed ASAP.

Flags: needinfo?(dwalsh) → needinfo?(francesco.lodolo)

Consider the first string.

# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message
# for the summarizing the selected search result. e.g. 5 of 10 results.
editor.searchResults=%d of %d results

"results" needs to be a proper plural.

English has 2 plurals (for "1" and any other number), each one separated by a semicolon character. Also, you need to use #1 for the variable replace by the number, not %S or %d

editor.searchResultsMessage=%d of #1 result;%d of #1 results

If you really want, you can leave the first form empty, and start with a semicolon.

editor.searchResultsMessage=;%d of #1 results

You also need a specific comment (and a new ID), per https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Use_proper_plural_forms

# LOCALIZATION NOTE (editor.searchResultsMessage): Semi-colon list of plural forms.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
# Editor Search bar message to summarize the selected search result. e.g. 5 of 10 results.
editor.searchResultsMessage=%d of #1 result;%d of #1 results

You need to use the plural form code to:

  • Identify the right substring to use based on #1 (PluralForm.get()), then replace #1 with the actual number of results.
  • Format the resulting string, replacing %d with the number.
Flags: needinfo?(francesco.lodolo)
Status: REOPENED → NEW

I would like to work on this issue. Thanks!

Assignee: nobody → bmiriam1230

Added proper plural form to editor.searchResults and sourceSearch.resultsSummary1. Updated the comments and IDs for the new strings as well. Replaced all instances of old string references with new string references.

Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65258ed1ea60
Use proper plural form in editor.searchResults and sourceSearch.resultsSummary1 r=davidwalsh,flod
Status: NEW → RESOLVED
Closed: 2 years ago5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
Attachment #9068141 - Attachment is obsolete: true
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.