Mon 25 Mar 2013 09:53:28 PM UTC, SVN revision 22597:
Uppercase first letter of notify messages if current locale is Finnish.
See patch #3028
(Browse SVN revision 22597) |
Mon 25 Mar 2013 09:53:22 PM UTC, SVN revision 22596:
Uppercase first letter of notify messages if current locale is Finnish.
See patch #3028
(Browse SVN revision 22596) |
Mon 18 Mar 2013 09:55:11 PM UTC, comment #7:
Reused from old patch:
- Actual uppercasing functionality
- Selection of languages to have uppercasing enabled
There's no gettext-like macro, but all notify messages are feeded to uppercasing once constructed.
(file #17447)
|
Sun 17 Mar 2013 11:05:43 PM UTC, comment #6:
This patch goes nowhere in resolving the uppercasing problem. It does uppercasing of the translated format string, so in the very case translator cannot uppercase her/himself, i.e., when the (translated) format string begins with "%s", subject to uppercasing is character "%". There's no way to cause uppercasing of the parameter string at this level (before the actual string has been constructed from format and parameters).
|
Wed 09 Nov 2011 10:39:11 PM UTC, comment #5:
> Ah so this isn't so much about forcing an uppercase but rather
> forcing a lowercase in the middle of a sentence?
Turning it that way around works in logic, but unfortunately I don't think it's technically feasible to implement that way. Oh, and I think it would cause problems with all western languages if there ever happens to be units with names of individuals (such as "Leader" units named after leader of the nation) THose should not be lowercased even in the middle of the sentence.
Anyway, as you see in comment #3, I improved the patch so that now capitalization is not forced to all translations, but you (translators) can opt your translation in. Obviously Gaelic should not be opted in. Well see if this code exist for Finnish translation only. ;-)
|
Wed 09 Nov 2011 10:18:31 PM UTC, comment #4:
Ah so this isn't so much about forcing an uppercase but rather forcing a lowercase in the middle of a sentence? So that something like
Mountains
becomes
Your engineers have converted this terrain to mountains
Is that it? That way round, it shouldn't be a problem for Gaelic, we use lowercase throughout anyway except for names.
|
Mon 07 Nov 2011 08:10:03 PM UTC, comment #3:
- Capitalization happens only if current language is in list translators can opt-in their language.
It's all-or-nothing for now. One your language has "subscribed" to autocapitalization, it will get it for all strings marked with C_() I already have long term plans to make that string-dependant, so you can have capitalization for unit names in the beginning of sentence, but still not capitalize when unit in question happens to be "van Helsing"
(file #14466)
|
Mon 07 Nov 2011 12:36:11 AM UTC, comment #2:
I'm not certain I totally understand the meaning of the suggested change but in Irish and Gaelic usually anything that forces uppercase initials is a terrible idea because we have words with obligatory lowercase initial irrespective of where they appear (e.g. h-Ăˆireann, h-ĂˆIREANN, t-aran, t-ARAN).
|
Mon 07 Nov 2011 12:17:17 AM UTC, comment #1:
I don't believe in wide use of C_(). Instead my idea is that translators request it to be used in some specific cases that are hard to resolve otherwise. Coders probably should not use it unless that way requested. (We may need to clean up all those uses when better solution for automatic uppercasing becomes available)
|
Mon 07 Nov 2011 12:08:41 AM UTC, original submission:
We sometimes want to have same translation to appear with lowercase first letter in some places, and uppercase first letter in other places. patch #3027 may eventually lead to good solution for this, but here's quick hack for urgent short-term (2.4, 2.3?) needs.
It introduces new macro C_() that returns string with first character uppercased in some cases. It works only if that said first character is 7-bit ascii character (single-byte UTF-8 character) This is not completely useless, as translators still control what word they push there. If all unit names in their translation start with ascii-character, they can put them via "%s" to the beginning of this kind of string. If some unit name does not begin with ascii-character, they cannot put it to the beginning, but neither were they able to do so before.
Note that unlike other xx_() macros, this does not return same statically allocated constant string for all identical calls, but returned string is constructed for each call. For this reason it has to be also freed with separate function call when string is no longer needed.
Uppercasing any other characters than first one in UTF-8 text would be hard, even if that particular character itself is ascii one. Since characters before it are variable width, it's not easy to tell which bytes belong to which character (or even if certain byte looking like ascii character is indeed ascii character or latter part of multibyte character)
|