Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespaces in strings considered harmful #4653

Closed
Wuzzy2 opened this issue Nov 24, 2013 · 11 comments

Comments

Projects
None yet
8 participants
@Wuzzy2
Copy link
Contributor

commented Nov 24, 2013

There are some strings which have lots of traling or leading whitespace. This doesn’t seem right to me. I think any leading or trailing spaces should usually be eliminated in the original strings. There may be some exceptions.

An example for this are the strings you see at the right part of the map. It seems those strings must have a constant length with the rest filled with spaces. Well, this sucks. What sucks even more is that launchpad.net automatically adds the same amount of white space as in the original string. It is not possible to disable this behaviour. I asked them. They told me that this whitespace stuff is a bad idea and I should go complain to you instead. :D To see the result of this, try CDDA 0.9 with the German translation (download it from Launchpad).

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@illi-kun

This comment has been minimized.

Copy link
Member

commented May 11, 2016

@VlasovVitaly @Night-Pryanik is this still an issue?

@cainiaowu

This comment has been minimized.

Copy link
Contributor

commented May 11, 2016

@illi-kun Most speed modifiers such like Overburdened -%s%d%% still use hardcoded whitespace to align.
searching 3 continuous whitespaces in current .pot results total of 246 line, which means 123 string have problems.

@illi-kun

This comment has been minimized.

Copy link
Member

commented May 11, 2016

I mean, is that an issue for translators?

@cainiaowu

This comment has been minimized.

Copy link
Contributor

commented May 11, 2016

Not for Chinese at least as translated strings are always shorter. I can filled the string to same length anyway.

Cant say about other languages.

@Wuzzy2

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2016

It's not really an “issue” anymore since we finally don't use that crappy Launchpad anymore. Now it's mostly like an annoyance.
I still think needless whitespace should be eliminated as far as possible, because it is pretty error-prone for translators. So I keep it open.

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 12, 2016

@Wuzzy2 If I understand it correctly, you meant something like "Speed:"? With space after colon?

@Wuzzy2

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2016

Not only this, but in general whitespace should be avoided.
I am not sure if whitespace is used that often anymore but it still a minor issue.

Regarding your example: Strings like “Speed: ” are really bad, not because of the whitespace but because it is an indication that string concatenation is used.
String concatenation is the mortal sin of internationalization!
Always use format strings, don't concatenate. In this case, you should use “Speed: %d” (or something like that).

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 17, 2016

@VlasovVitaly

This comment has been minimized.

Copy link
Contributor

commented May 18, 2016

We already have all methods for Unicode strings. But ofc they not cover all code.

This issue should be closed. And similar issues must be opened for all particular string(s).

Agree with Wuzzy2/// String concatenation is the mortal sin of internationalization!

@illi-kun

This comment has been minimized.

Copy link
Member

commented May 18, 2016

I agree with @VlasovVitaly, this issue contains general complains but doesn't point out the exact "bad" strings (except 'map' menu but it's mentioned just as an example), it's simply not possible to "fix" this issue because "bad" strings aren't listed.

@BrettDong

This comment has been minimized.

Copy link
Contributor

commented Nov 19, 2016

@illi-kun This should be closed?

@illi-kun illi-kun closed this Nov 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.