bugGNUstep - Bugs: bug #52494, Does not handle exceptions when...

Group
 
 

bug #52494: Does not handle exceptions when loading translations

Submitter:  Yavor Doganov <yavor>
Submitted:  Fri 24 Nov 2017 02:36:29 PM UTC
   
 
Category:  Gorm Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  gcasa
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 26 Jan 2018 05:26:57 AM UTC, comment #3: 

The applied fix is basically my proposed patch, with one minor nuance.  I have already tested it.

Yavor Doganov <yavor>
Thu 25 Jan 2018 02:12:29 AM UTC, comment #2: 

This should now be fixed.  Please test.

Gregory John Casamento <gcasa>
Group administrator
Fri 24 Nov 2017 09:55:37 PM UTC, comment #1: 

One thing is bothering me... GUI sets its own exception handler so if application code does not catch an exception, a critical alert panel must be shown in addition to the usual logging that comes from Base.   In this case there is no alert panel and nothing is logged.  I thought it might be a bug in the runtime but at first glance it doesn't seem so.  A minimalistic program ([NSApplication sharedApplication] immediately followed by code that triggers an exception) works as expected.

I'm quite certain there's another bug here; uncaught exceptions shouldn't be swept under the carpet.  Any ideas?

Yavor Doganov <yavor>
Fri 24 Nov 2017 02:36:29 PM UTC, original submission:  

I tried to translate a .gorm file using Gorm's Document->Translate feature.  Exported the strings fine but couldn't load the translated .strings file.  I selected the file in the open panel, pressed OK, the panel disappeared but nothing happened.  It took me some time to figure out what's going on...

The exported strings are unquoted when there is only one word and I simply forgot to quote one translated string.  So the exception that is rasied in GSPropertyListFromStringsFormat is not caught by Gorm.  IMHO this is not proper behavior: Gorm should report the error, otherwise the user is left wondering what actually happened.  Also, you should not assume that translators are aware that strings must be quoted, so I think it is a good idea to provide them with some hint (using the established practice of conveying information with a comment starting with "TRANSLATORS:").

Attached is a patch that fixes this issue.  I see that the ChangeLog has not been updated recently, but here is a suggested entry anyway:

2017-11-24  Yavor Doganov  <yavor@gnu.org>

  • GormCore/GormDocument.m (translate:): Add exception handling

when loading translations.
(exportStrings:): Prepend notice for translators.

Yavor Doganov <yavor>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gcasa (Posted a comment)
  • -email is unavailable- added by yavor (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-25 gcasa StatusNone Fixed
        Assigned toNone gcasa
        Open/ClosedOpen In Test
    2017-11-24 yavor Attached File- Added 0001-Add-exception-handling-when-loading-translations.patch, #42468

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code