So in english we don't have gendered nouns. It is always "a table" or "a desk" with no need to worry about it being "une table" or "un tableau" (french). So my question is that when working on the french .mo file, how does one translate a string such as :

2 Answers
2

This is not a problem if every string gets its own template for translation.

If you use the string You can include a %s in a childtheme. more than one time for different nouns it is not translatable.

An example, taken from a recent article: New %s is in German (yes, we have gendered nouns too) …

Neues Buch (for a book, neutral)

Neuer Film (for a movie, masculine)

… so you have to write New bookandNew movie or You can include a logo in a child theme.andYou can include a stylesheet in a child theme..

Side note

That’s one of the reasons why translation files take so much memory: You have to “repeat” many very similar strings. While a WordPress installation in English will probably run fine with 32MB PHP memory it will just die if you use the same with a German or French translation.

If your theme or plugin is using many translatable strings for front-end and back-end consider using two files: one for the back-end and a separate file for the front-end.

thanks toscho. i guess i need to dig deeper into the purpose of the original string and see what %s is being used for. how do i separate the back-end and front-end strings?
–
helgathevikingJun 14 '12 at 12:04

gotcha. thanks for that. one more thing, if the string is only used once, can you leave it with %s and just provide clarification of context?
–
helgathevikingJun 14 '12 at 12:23

@helgatheviking Yes, you do that. But I don’t see how this would make translation easier. The context parameter has to be a hard coded string too; you cannot use a PHP variable here.
–
toscho♦Jun 14 '12 at 12:47

"yes, we have gendered nouns too" remembers me of Mark Twain: Whenever the literary German dives into a sentence, that is the last you are going to see of him till he emerges on the other side of his Atlantic with a verb in his mouth.
–
brasofiloJun 14 '12 at 13:02

phew, this translation stuff is complicated. clearly i take being a native-anglophone for granted! if this thread would be better at WP Polyglots I hope someone will move it.
–
helgathevikingJun 14 '12 at 12:02

Well, now, au contraire, with the canonical answer provided by toscho, WP Polyglots may use this post as reference for the subject :)
–
brasofiloJun 14 '12 at 13:00