[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Update of patch #3028 (project freeciv): Status: Ready For Test = Invalid Assigned to:None = cazfi Open/Closed:Open = Closed ___ Follow-up 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). ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Follow-up Comment #4, patch #3028 (project freeciv): 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. ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Follow-up Comment #5, patch #3028 (project freeciv): 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. ;-) ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Follow-up Comment #3, patch #3028 (project freeciv): - 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) ___ Additional Item Attachment: File name: C_macro_3028-2.diffSize:3 KB ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
URL: http://gna.org/patch/?3028 Summary: Macro to uppercase first letter of string Project: Freeciv Submitted by: cazfi Submitted on: Mon 07 Nov 2011 02:08:41 AM EET Category: general Priority: 5 - Normal Status: Ready For Test Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: 2.4.0, 2.5.0 ___ Details: 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) ___ File Attachments: --- Date: Mon 07 Nov 2011 02:08:41 AM EET Name: C_macro.diff Size: 3kB By: cazfi http://gna.org/patch/download.php?file_id=14460 ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Follow-up Comment #1, patch #3028 (project freeciv): 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) ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3028] Macro to uppercase first letter of string
Follow-up Comment #2, patch #3028 (project freeciv): 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). ___ Reply to this item at: http://gna.org/patch/?3028 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev