Words order isn't i18n friendly

Bug #198365 reported by Alexandre Prokoudine
4
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
Low
Stani

Bug Description

In a number of cases Phatch doesn't respect langauges other than English.

For example, in Save action's dialog there are messages like "PNG Optimize" or "JPG Size Maximum". Translatable part is "Optimize" and "Size Maximum" only. Thjis is perfectly OK for English, but in Russian the words order will be "Optimize PNG" and "Maximum Size of JPG" respectively.

The usual way to handle this is using variables. E.g.: "% Optimize" and "%s Size Maximum". Then translators can place the variable whereever they like it.

Same applies to dialogs captions. E.g. "Phatch actions" where only "actions" is translatable.

Until you fix it, translated GUI will look ugly :(

Revision history for this message
Stani (stani) wrote :

All the examples you will give here in the bug report will be fixed in Phatch 0.2 So feel free to add more whenever you encounter them.

Changed in phatch:
assignee: nobody → stani
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

This patch fixes those in the Save action.

After implementing https://blueprints.launchpad.net/phatch/+spec/improve-action-lists-format we could simplify things a bit.

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Hmm, I've just realized that patch will break the action list saved files... perhaps we should wait for that blueprint to be implemented?

Stani (stani)
Changed in phatch:
status: Confirmed → Triaged
Revision history for this message
Stani (stani) wrote :
Download full text (6.6 KiB)

I tried to fix this in all places I am aware of:

=== modified file 'phatch/actions/save.py'
--- phatch/actions/save.py 2008-02-29 17:12:11 +0000
+++ phatch/actions/save.py 2009-04-14 21:44:47 +0000
@@ -48,11 +48,11 @@
         fields[_t('In')] = self.FilePathField(self.DEFAULT_FOLDER,
                                         choices=self.FOLDERS)
         fields[_t('Resolution')] = self.DpiField(choices=self.DPIS)
- fields['PNG '+_t('Optimize')] = self.BooleanField(False)
- fields['JPG '+_t('Quality')] = self.SliderField(85,1,100)
- fields['JPG '+_t('Size Maximum')] = self.FileSizeField('0kb',
+ fields[_t('PNG Optimize')] = self.BooleanField(False)
+ fields[_t('JPG Quality')] = self.SliderField(85,1,100)
+ fields[_t('JPG Size Maximum')] = self.FileSizeField('0kb',
           choices=SIZES)
- fields['JPG '+_t('Size Tolerance')] = self.FileSizeField('5%',
+ fields[_t('PNG Size Tolerance')] = self.FileSizeField('5%',
             choices=TOLERANCES)

     def apply_pil(self,image):

=== modified file 'phatch/core/api.py'
--- phatch/core/api.py 2009-02-17 01:26:42 +0000
+++ phatch/core/api.py 2009-04-14 21:51:25 +0000
@@ -37,7 +37,7 @@
         self.filename = filename

     def __str__(self):
- return u'"%s" '%self.filename+_('is not a valid path')+'.'
+ return u_('"%s" is not a valid path.')%self.filename

 class ReadOnlyDict:
     def __init__(self,data):

=== modified file 'phatch/core/ct.py'
--- phatch/core/ct.py 2008-04-22 15:27:58 +0000
+++ phatch/core/ct.py 2009-04-14 21:34:20 +0000
@@ -73,7 +73,7 @@
 PREVIEW_PATH = os.path.join(APP_USER_PATH,'preview')

 LABEL_PHATCH_ACTIONLIST = '%s %s %%s...'%(INFO['name'],_('with'))
-LABEL_PHATCH_RECENT = INFO['name']+' '+_('Recent')
+LABEL_PHATCH_RECENT = _('%s Recent')%INFO['name']
 LABEL_PHATCH_INSPECTOR = _('Image Inspector')

 INTEGRATE_PHATCH_ACTIONLIST = _("Associate Images with Action List in %s...")

=== modified file 'phatch/linux/droplet.py'
--- phatch/linux/droplet.py 2008-03-04 00:48:01 +0000
+++ phatch/linux/droplet.py 2009-04-14 21:40:52 +0000
@@ -131,8 +131,9 @@
     name = os.path.splitext(os.path.basename(actionlist))[0]
     title = name.replace('_',' ').replace('-',' ').title()
     create_nautilus_extension(
- name = 'phatch_actionlist_'+name.encode('ascii','ignore'),
- label = '"Phatch "+_("%s")+" %s..."'%(_t('with'),title),
+ name = 'phatch_actionlist_'+\
+ name.encode('ascii','ignore'),
+ label = '_("%s")+"..."'%_t('Phatch with %s')%title,
         command = 'phatch -d "%s" %%s &'%actionlist,
         mimetypes = IMAGE_READ_MIMETYPES,
         tooltip = TOOLTIP,
@@ -244,4 +245,4 @@
         actionlist = '/home/stani/sync/python/phatch/action lists/tutorials/thumb round 3d reflect.phatch',
         folder = '/home/stani/sync/Desktop',
     )
-
\ No newline at end of file
+

=== modified file 'phatch/pyWx/gui.py'
--- phatch/pyWx/gui.py 2009-03-30 23:54:...

Read more...

Changed in phatch:
importance: Wishlist → Low
status: Triaged → In Progress
Revision history for this message
Stani (stani) wrote :

$ bzr commit -m "making word order translation friendly"
Committing to: /home/stani/sync/python/phatch/trunk/
modified locale/en/LC_MESSAGES/phatch.mo
modified locale/en/LC_MESSAGES/phatch.pot
modified locale/nl/LC_MESSAGES/phatch.mo
modified locale/nl/LC_MESSAGES/phatch.po
modified phatch/actions/save.py
modified phatch/core/api.py
modified phatch/core/ct.py
modified phatch/linux/droplet.py
modified phatch/pyWx/gui.py
modified phatch/pyWx/lib/wxcheck.py
Committed revision 566.

$ bzr push bzr+ssh://<email address hidden>/~stani/phatch/dev
Pushed up to revision 568.

This fix is available in the bzr repository and will be part of next release. Please update the translations in Launchpad and let me know if some translations are still unclear or need comments.

Changed in phatch:
status: In Progress → Fix Committed
Revision history for this message
Stani (stani) wrote :

It looks like in formfield.py there are still some strings to be fixed. Other strings should be checked with poedit and regexxer.

Changed in phatch:
status: Fix Committed → In Progress
Revision history for this message
Stani (stani) wrote :
Download full text (21.7 KiB)

$ bzr commit -m "fix translations strings"
Committing to: /home/stani/sync/python/phatch/trunk/
modified locale/en/LC_MESSAGES/phatch.mo
modified locale/en/LC_MESSAGES/phatch.pot
modified phatch/core/lib/formField.py
modified phatch/pyWx/gui.py

=== modified file 'locale/en/LC_MESSAGES/phatch.mo'
Binary files locale/en/LC_MESSAGES/phatch.mo 2009-06-05 13:15:12 +0000 and locale/en/LC_MESSAGES/phatch.mo 2009-06-05 13:52:18 +0000 differ
=== modified file 'locale/en/LC_MESSAGES/phatch.pot'
--- locale/en/LC_MESSAGES/phatch.pot 2009-06-05 13:15:12 +0000
+++ locale/en/LC_MESSAGES/phatch.pot 2009-06-05 13:52:18 +0000
@@ -2,8 +2,8 @@
 msgstr ""
 "Project-Id-Version: Phatch\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-05 15:10+0100\n"
-"PO-Revision-Date: 2009-06-05 15:10+0100\n"
+"POT-Creation-Date: 2009-06-05 15:52+0100\n"
+"PO-Revision-Date: 2009-06-05 15:52+0100\n"
 "Last-Translator: Stani <email address hidden>\n"
 "Language-Team: <email address hidden>\n"
 "MIME-Version: 1.0\n"
@@ -572,265 +572,254 @@
 msgid "Use the Image Inspector to list all the variables."
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:38
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:36
+msgid "You can only use files with the following extensions"
+msgstr ""
+
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
 msgid "left"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:38
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
 msgid "center"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:38
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
 msgid "right"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:40
 msgid "top"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:40
 msgid "middle"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:39
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:40
 msgid "bottom"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:52
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:53
 msgid "Monochrome (1-bit pixels, black and white)"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:53
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:54
 msgid "Grayscale (8-bit pixels, black and white)"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:54
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:55
 msgid "RGB (3x8-bit pixels, true color)"
 msgstr ""

-#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formField.py:55
+#: /home/stani/sync/python/phatch/trunk/phatch/core/lib/formF...

Changed in phatch:
status: In Progress → Fix Committed
Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.