After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162866 - Please avoid string surgery for ordinals in gnome-schedule
Please avoid string surgery for ordinals in gnome-schedule
Status: RESOLVED FIXED
Product: gnome-schedule
Classification: Other
Component: general
0.1.0
Other All
: Urgent blocker
: ---
Assigned To: GNOME Schedule Maintainers
GNOME Schedule Maintainers
Depends on: 156820 162848 162870
Blocks:
 
 
Reported: 2005-01-03 23:02 UTC by Christian Rose
Modified: 2005-08-16 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
helper dialog mockup (5.96 KB, image/png)
2005-08-15 00:59 UTC, Frank Arnold
Details

Description Christian Rose 2005-01-03 23:02:27 UTC
#: src/crontabEditorHelper.py:197 src/crontabEditorHelper.py:208
msgid "st. "

#: src/crontabEditorHelper.py:199
msgid "th. "

		try:
			entFixValue = int (self.entFix.get_text())
			if entFixValue == 1:
				self.lblFixEntity.set_label (_("st. ") + self.trans_field)
			else:
				self.lblFixEntity.set_label (_("th. ") + self.trans_field)
		except:
			pass

		try:
			entEveryValue = int (self.entEvery.get_text())
			if entEveryValue > 1:
				self.lblEveryEntity.set_label (self.trans_field + _("s"))
			else:
				self.lblEveryEntity.set_label (_("st. ") + self.trans_field)
		except:
			pass

Please *never* do string surgery like this! This is inheritly untranslatable. As
you should know, ordinals are different in almost every language. I'm amazed
that this string surgery in code would even work for one.
Comment 1 Philip Van Hoof 2005-04-16 13:02:59 UTC
*** Bug 162848 has been marked as a duplicate of this bug. ***
Comment 2 Philip Van Hoof 2005-04-16 13:03:47 UTC
*** Bug 162870 has been marked as a duplicate of this bug. ***
Comment 3 Philip Van Hoof 2005-04-16 13:05:39 UTC
*** Bug 156820 has been marked as a duplicate of this bug. ***
Comment 4 Philip Van Hoof 2005-04-16 13:49:05 UTC
The dups are not really dups. But the person who's going to fix translation
issues will need to fix all of them before I consider it as a fix :-).

Please set this bug to assigned if you plan to work on this.
Comment 5 Danilo Segan 2005-04-16 18:45:39 UTC
Then, you should have made them block this one instead (look for field "Bug
#xxxx blocks:").
Comment 6 Gaute Hope 2005-08-12 13:49:44 UTC
changed all the duplicates to blockers.
Comment 7 Frank Arnold 2005-08-15 00:58:28 UTC
Gaute, in reply to your message to gnome-schedule-devel list:

"... To be able to translate every 'Happens the [ ] minute' strings I created
a function that splits the translated string on '[ ]' so that a
translator can write text with textentries inside ..."

This doesn't solve the entire problem. The first thing is that you use ordinals
again inside your sentence. You could see it in English already (Happens the
five minute). The probably bigger problem is, that this sentence needs plural
handling. Some languages may require to change the "minute" part according to
the count. But you cannot use ngettext because you have a text entry instead of
a string in between. 

The only solution I see is to redesign the helper dialog a little bit. I've made
a fast mockup that should fit our needs as translators and follows the HIG quite
good. The "Other expression" option is useless and therefore dropped. One can
type directly into editor window fields without having to start the helper.

Comment 8 Frank Arnold 2005-08-15 00:59:42 UTC
Created attachment 50706 [details]
helper dialog mockup
Comment 9 Gaute Hope 2005-08-15 10:44:09 UTC
Yes, seems much easier. And doesn't look ugly. Please commit.
Comment 10 Frank Arnold 2005-08-15 11:31:18 UTC
There's nothing to commit. Made the picture only... :)
Comment 11 Gaute Hope 2005-08-15 12:44:35 UTC
I changed it into something like yours.. but it looks kinda ugly. 
Comment 12 Gaute Hope 2005-08-16 10:53:08 UTC
Updated the gui some, we'll go for this solution.