Code review comment for lp:~gunchleoc/widelands/i18n-20140307

Revision history for this message
GunChleoc (gunchleoc) wrote :

> > I am adding those because semantically empty line breaks are confusing for
> translators, thus creating extra work for them + head scratching.
>
> Can we find another way? How about introducing a 'texts' secion in each file
> where we do not care about the length of lines? We could do one sentence per
> translated unit or so. I think that makes it pretty easy to work with - it
> also means that diffs are more meaningful as each change is a change per
> sentence.

OK, I will do that in the future. Most of the long texts are in scenarios as well.

I have created strings like that all over the place, maybe leave them for now and only change the code when we need to fix a string?

> // TODO: This should be ngettext(" %i player" etc. with
>
> not sure what the problem is here. I'll need to investigate a bit more. I put
> it onto my list.
>
> I saw in some other places that you had trouble with segfaults. The reason is
> that only boost::format understands std::string directly. Everything else
> needs .c_str() like so:

I copy/pasted code that is working from somewhere else, so the problem must be in turning the number into a string somehow. I tried both %u and %i, something like this:

(format(ngettext("%u player", "%u players, player_no)) % player_no).str().c_str()
Maybe it's a stupid error with the brackets or something.

« Back to merge proposal