Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1165 closed defect (bug) (fixed)

Placeholder is not replaced with the appropriate string for meta plugins translation

Reported by: aaleksanyants's profile aaleksanyants Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Plugin Directory Keywords:


The string with bug is the following:

%1$s of %2$s support threads in the last %3$s have been resolved.

I have translated it to Armenian in the following way:

Վերջին %3$s կարգավորվել է %2$s-ից %1$s աջակցման հոսք։

If you open and check support section in the right column you will see the following:

Վերջին two months կարգավորվել է 10-ից 0 աջակցման հոսք։

Another issue with that translation is that is does not contain singular/plural versions for stars, even 1 star is displayed as 1 starS

Change History (6)

#1 @coffee2code
8 years ago

It's unclear to me what you're saying is incorrect. What are you expecting for the translated string? The placeholder replacements look fine to me.

%1$s is the number of resolved support threads.
%2$s is the number of total support threads.
%3$s is the string "two months".

They are replaced in the order you specified in your translation.

If you are noting that the "two months" phrase is not being translated, you are correct. I can adjust the string since that phrase is not variable any longer, so it'll be:
%1$s of %2$s support threads in the last two months have been resolved.

Would that resolve your issue, or does a different change need to happen?

Last edited 8 years ago by coffee2code (previous) (diff)

#2 @aaleksanyants
8 years ago

OK, if "two months" phrase is not a variable, it should be corrected in the way you suggested, so that the whole sentence gets translated.

And what about starS?

#3 @coffee2code
8 years ago

  • Owner set to coffee2code
  • Status changed from new to accepted

#4 @coffee2code
8 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in [10760-dotorg] (make the "two months" phrase part of the string rather than being an untranslated variable string) and [10761-dotorg] (make the ratings chart string "%d star")

@aaleksanyants : I changed the stars string that you brought up to be %d star. This is perhaps less than ideal, but it is better than being %d stars and having the odd "1 stars" string. The singular use of "star" in this context is also how does it, so there's some precedent.

We don't support variable length strings for this because it would throw off the alignment of the ratings chart given its current implementation. Therefore, we don't do pluralization (e.g. "1 star" and "2 stars"), and it's also why the translation does not allow for singular/plural. We may change this in the future, but we'd have to make CSS and markup changes in order to do so.

#5 @dd32
8 years ago

In [10769-dotorg] I switched out the %d star for a plural form of %d star, %d stars and updated some styles to better handle the longer translations.

It may still be misaligned in some languages, if so, try to keep the translation as succinct as possible.

#6 @coffee2code
8 years ago

@dd32: My original change for the stars was exactly what you implemented (but with differing min-width), but I wasn't confident it would properly cover all translations, which even after [10770-dotorg] it did not appear to do so.

RU (, IS (, NL ( were among a few I spot-checked that were misaligned.

The approach also triggered #1169, which was still an issue after [10772-dotorg], such as for IS, NL, HR (

In [10773-dotorg] I further adjusted widths to accommodate longer translations, shrinking the rating bars to do so and to accommodate longer rating counts.

Note: See TracTickets for help on using tickets.