开发者

Gettext genitive

Let's say I want to display the following text to the user:

"John's car"

I'm using gettext to output it:开发者_Go百科

sprintf(_("%s's car"), $firstName)

The obvious problem is that, if the first name of the user ends in an S, we'll get something like this:

"James's car" (should be "James' car")

How do I solve that problem, especially considering that other languages might pose a similar challenge (different genitives depending on word ending or similar)?


Simply put: write a function with an explicit if to get the genitive form for a name, and print that instead. I'd provide an example but you haven't indicated what language we're talking about!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜