Opened 11 years ago
Closed 11 years ago
#27069 closed defect (bug) (fixed)
Twenty Fourteen: Incorrect internationalization in Ephemera widget
Reported by: | Chouby | Owned by: | lancewillett |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
The string More %s <span class="meta-nav">→</span>
does not allow accurate translations as it does not follow i18n best practices, which require to translate whole sentences. For example, in French, "More videos" is translated in "Plus de vidéos" and "More images" is translated in "Plus d'images". The translator is currently forced to translate the latest as "Plus de images" which is really ugly.
Moreover storing translatable strings in private variables (here $format_strings) is in my opinion not a good idea (as it prevents some multilingual plugins to translate these strings). So it would be preferrable to make $format_strings either public or protected to avoid a complete rewrite of the widget.
Attachments (6)
Change History (23)
#1
@
11 years ago
- Description modified (diff)
- Summary changed from Twenty fourteen: incorrect internationalization in Ephemera widget to Twenty Fourteen: Incorrect internationalization in Ephemera widget
#3
@
11 years ago
I do not think that these are taxonomy names? For example string "Galleries" is related only to Twenty Fourteen, but there is another core string "Gallery" for related post format. I had no problems with it, I translated "Galeries" as "Galerie" and this string is used only for archives and "More" string. So "More ..." could be translated as only "Plus" and "Images" as "d'images" in Czech (only example). But I really do not know about French possibilities...
But in the end I do not like the idea of many new strings, what about only "More" or "More items"?
#4
@
11 years ago
These are plural post format names (see also #23257).
The problem is that they are also used as standalone strings in the widget title:
tags/3.8.1/src/wp-content/themes/twentyfourteen/inc/widgets.php#L76
"More" seems fine to me.
#5
follow-ups:
↓ 6
↓ 7
@
11 years ago
Yes, I know about missing plural post format names, but this case is only related to Twenty Fourteen, so I took it as only special strings not related to any taxonomy. And I think that it is possible to translate them, even if with some more creativity :-) What about Russian, any problems?
You are right that post format plural names should not be used here. Even if there would be plural forms for post format names, it does not solve related problems definitely. Example: "Notes" - plural post format name, in Czech "Poznámky", but in sentence it can be also "Poznámek" in some circumstances (for example inflexion - accusative case).
Yes, I know about widget title, but it still works fine in Czech :-)
You patch is fine, it looks better when there is "More Videos" than only "More". But there are many new strings for this little feature...
#6
in reply to:
↑ 5
@
11 years ago
Replying to pavelevap:
But there are many new strings for this little feature...
For what reason do you think it's disturbing?
- Additional translator work -> "More" would be the best solution to avoid this
- Increased mo file size -> same as above
- Performance issue due to more gettext calls -> We can decide to translate only the strings of the actual format in the widget function (will also decrease the number of translations in case the widget is used several time with different post formats as currently the private $format_strings array is translated for each widget).
#7
in reply to:
↑ 5
@
11 years ago
Replying to pavelevap:
What about Russian, any problems?
We don't use capital letters in the middle of a sentence ("Другие Заметки" should be "Другие заметки"). It's currently impossible to change that, as "Заметки" is also used as a standalone string in the widget title (same for other formats).
Luckily, the problem isn't noticeable in Twenty Fourteen due to text-transform: uppercase
:-)
#8
@
11 years ago
27069.2.patch illustrates what I meant above by
We can decide to translate only the strings of the actual format in the widget function
#9
@
11 years ago
In 27069.2.patch, printf()
should not be removed in line 211, otherwise $format_string_more
is unused.
#10
@
11 years ago
Yes sure. I mixed myself as I initially implemented your proposal to use "More" only. I should also not remove the $format variable which is used outside the removed code. Both are fixed in 27069.2.2.patch.
#11
@
11 years ago
27069.3.patch fixes a typo in 27069.2.2.patch ("More asides" vs. "More aside").
This ticket was mentioned in IRC in #wordpress-themes by lancewillett. View the logs.
11 years ago
#14
@
11 years ago
Discussing in IRC today (see handy link above) we decided to improve this by adding context to the more HTML and arrow output so translators know what it's for.
Yeah, we should avoid post type and taxonomy names in generic strings, as noted in ticket:17609:3 and ticket:19099:1.