View Issue Details

IDProjectCategoryView StatusLast Update
0017218LazarusLCLpublic2010-09-13 00:01
ReporterStephanoAssigned ToMaxim Ganetsky 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Platformx86OSUbuntuOS Version10.04
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0017218: DefaultTranslator: --lang command line parameter does not override LANG environment variable
DescriptionI suppose a command line parameter should override an environment variable. It is not the case in DefaultTranslator.

Patch is attached.
TagsNo tags attached.
Fixed in Revision27158
LazTarget0.9.30
WidgetsetGTK 2
Attached Files
  • DefaultTranslator.diff (868 bytes)
    Index: defaulttranslator.pas
    ===================================================================
    --- defaulttranslator.pas	(revision 27154)
    +++ defaulttranslator.pas	(working copy)
    @@ -176,15 +176,14 @@
     
     begin
       Result := '';
    +  Lang := '';
    +  for i := 1 to Paramcount - 1 do
    +    if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
    +      (ParamStrUTF8(i) = '--lang') then
    +      Lang := ParamStrUTF8(i + 1);
       //Win32 user may decide to override locale with LANG variable.
    -  Lang := GetEnvironmentVariableUTF8('LANG');
       if Lang = '' then
    -  begin
    -    for i := 1 to Paramcount - 1 do
    -      if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
    -        (ParamStrUTF8(i) = '--lang') then
    -        Lang := ParamStrUTF8(i + 1);
    -  end;
    +    Lang := GetEnvironmentVariableUTF8('LANG');
       if Lang = '' then
         LCLGetLanguageIDs(Lang, T);
     
    

Activities

2010-08-20 13:31

 

DefaultTranslator.diff (868 bytes)
Index: defaulttranslator.pas
===================================================================
--- defaulttranslator.pas	(revision 27154)
+++ defaulttranslator.pas	(working copy)
@@ -176,15 +176,14 @@
 
 begin
   Result := '';
+  Lang := '';
+  for i := 1 to Paramcount - 1 do
+    if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
+      (ParamStrUTF8(i) = '--lang') then
+      Lang := ParamStrUTF8(i + 1);
   //Win32 user may decide to override locale with LANG variable.
-  Lang := GetEnvironmentVariableUTF8('LANG');
   if Lang = '' then
-  begin
-    for i := 1 to Paramcount - 1 do
-      if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
-        (ParamStrUTF8(i) = '--lang') then
-        Lang := ParamStrUTF8(i + 1);
-  end;
+    Lang := GetEnvironmentVariableUTF8('LANG');
   if Lang = '' then
     LCLGetLanguageIDs(Lang, T);
 

Maxim Ganetsky

2010-08-20 22:21

developer   ~0040355

Applied, thanks.

Issue History

Date Modified Username Field Change
2010-08-20 13:31 Stephano New Issue
2010-08-20 13:31 Stephano File Added: DefaultTranslator.diff
2010-08-20 13:31 Stephano Widgetset => GTK 2
2010-08-20 21:36 Maxim Ganetsky LazTarget => 0.9.30
2010-08-20 21:36 Maxim Ganetsky Status new => assigned
2010-08-20 21:37 Maxim Ganetsky Assigned To => Maxim Ganetsky
2010-08-20 22:21 Maxim Ganetsky Fixed in Revision => 27158
2010-08-20 22:21 Maxim Ganetsky Status assigned => resolved
2010-08-20 22:21 Maxim Ganetsky Fixed in Version => 0.9.29 (SVN)
2010-08-20 22:21 Maxim Ganetsky Resolution open => fixed
2010-08-20 22:21 Maxim Ganetsky Note Added: 0040355
2010-09-13 00:01 Stephano Status resolved => closed