View Issue Details

IDProjectCategoryView StatusLast Update
0017046LazarusLCLpublic2010-07-29 13:57
ReporterMarelisAssigned ToMaxim Ganetsky 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSUbuntuOS Version10.04
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0017046: DefaultTranslator not find the file in 'app/locale/*/LC_MESSAGES/'
DescriptionThe attached patch changes the LangID to LangShortID. Using LangID is somewhat unusual, as the Czech localization has LangID "cs_CZ.utf8", while the usual LangShortID is "cs".

Other ways to find a file using the LangShortID (function GetLocaleFileName).

P.S. - After a small break, I again use the Lazarus IDE, so again I'll bother with errors :o)
TagsNo tags attached.
Fixed in Revision26881
LazTarget-
Widgetset
Attached Files
  • defaulttranslator.patch (527 bytes)
    --- defaulttranslator.pas.orig	2010-07-26 22:21:43.404198000 +0200
    +++ defaulttranslator.pas	2010-07-27 12:18:47.848808372 +0200
    @@ -124,7 +124,7 @@
             exit;
     
           Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
    -        + LangID + DirectorySeparator + 'LC_MESSAGES' + DirectorySeparator +
    +        + LangShortID + DirectorySeparator + 'LC_MESSAGES' + DirectorySeparator +
             ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
           if FileExistsUTF8(Result) then
             exit;
    

Activities

2010-07-27 12:35

 

defaulttranslator.patch (527 bytes)
--- defaulttranslator.pas.orig	2010-07-26 22:21:43.404198000 +0200
+++ defaulttranslator.pas	2010-07-27 12:18:47.848808372 +0200
@@ -124,7 +124,7 @@
         exit;
 
       Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
-        + LangID + DirectorySeparator + 'LC_MESSAGES' + DirectorySeparator +
+        + LangShortID + DirectorySeparator + 'LC_MESSAGES' + DirectorySeparator +
         ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
       if FileExistsUTF8(Result) then
         exit;

Jesus Reyes

2010-07-28 20:59

developer   ~0039765

shouldn't this be an additional test instead of replacing the test?

Marelis

2010-07-28 21:45

reporter   ~0039767

GetLocaleFileName function has two parts. The first seeks to LangID and the second with LangShortID. And just at that second part is a problem with LangID, there has to be mentioned LangShortID.

And what I noticed in this second part of yet another indication LangID. Simply fly over the eyes. For my application this is not a problem, but someone that may complicate the search for a file with this function.

Thx.

Maxim Ganetsky

2010-07-29 00:28

developer   ~0039770

Thanks for the hint. This is indeed a typo.
Please test and close if ok.

Marelis

2010-07-29 13:57

reporter   ~0039790

It works well, thanks.

Issue History

Date Modified Username Field Change
2010-07-27 12:35 Marelis New Issue
2010-07-27 12:35 Marelis File Added: defaulttranslator.patch
2010-07-28 20:58 Jesus Reyes Status new => assigned
2010-07-28 20:58 Jesus Reyes Assigned To => Maxim Ganetsky
2010-07-28 20:59 Jesus Reyes Note Added: 0039765
2010-07-28 21:45 Marelis Note Added: 0039767
2010-07-29 00:28 Maxim Ganetsky Fixed in Revision => 26881
2010-07-29 00:28 Maxim Ganetsky LazTarget => -
2010-07-29 00:28 Maxim Ganetsky Status assigned => resolved
2010-07-29 00:28 Maxim Ganetsky Fixed in Version => 0.9.29 (SVN)
2010-07-29 00:28 Maxim Ganetsky Resolution open => fixed
2010-07-29 00:29 Maxim Ganetsky Note Added: 0039770
2010-07-29 13:57 Marelis Status resolved => closed
2010-07-29 13:57 Marelis Note Added: 0039790