Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#3857 closed defect (bug) (invalid)

Translations: Treat strings with unique comments as unique

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:



This originally stems from GP, but as it just uses the source POT strings than would be an issue with the string extractor or possible the core as it might require context be added instead of segregating by unique comments.

Original GP -

When a string with multiple instances has a comment supplied that's unique for each instance those instances should all be unique rows instead of a merged instance as those comments can provide context which may lead to alternate translations.
Some examples;
In most of the above cases the comment is to indicate what a param is and in the above it's different in some cases as in one it's about the page while the other is the term, etc.
Due to this would make sense that each would be a unique translation.

Let me know if this is more an issue of adding context via core code rather than updating the string extractor to take unique comments into account and distinguishing each unique instance as it's own string. If that's the case I'll open a core ticket to add context to strings.


Attachments (1)

Screen Shot 2018-10-02 at 3.11.12 PM.png (69.6 KB) - added by garrett-eclipse 6 years ago.
String with two instances both which have unique comments

Download all attachments as: .zip

Change History (4)

6 years ago

String with two instances both which have unique comments

#1 @yoavf
6 years ago

What makes a string unique is the combination of its context and its text (or just singular text if it has a plural). If a string is different enough that it can have different translations, then a context should be used (with or without a comment).

If for the examples above any translator feels like a context should be added (because they would like to supply a different translation), then it warrants a core ticket to add a context to one or more instances of the string.

#2 @tobifjellner
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I think we can close this ticket.
We do have this specific possibility, when needed, by using _x() and similar functions that allow for context to be specified.
But the comment in itself is NOT a part of the lookup and cannot be used to separate strings from each other.

#3 @garrett-eclipse
5 years ago

Thanks @yoavf and @tobifjellner that makes sense. I'll review the strings I thought should be segregated when I have some more time and open the appropriate tickets in core to introduce context. Appreciate the feedback

Note: See TracTickets for help on using tickets.