[Gambas-user] Issue 209 in gambas: Inheritance and translatable constant strings does not work

gambas at ...2524... gambas at ...2524...
Fri Feb 10 21:17:05 CET 2012


Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 209 by emil.len... at ...626...: Inheritance and translatable  
constant strings does not work
http://code.google.com/p/gambas/issues/detail?id=209

1) Describe the problem.
Let's say you have a base class with a string constant that is not  
translatable. If you now inherit the class and override the string constant  
with a translatable string, the translated version of the string is not  
always used.

The problem is caused by an optimization in gbx_exec_push.c

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: TRUNK
Revision: r4463

3) Provide a little project that reproduces the bug or the crash.
Class1:
Public Const ConstString As String = "hello"

Class2:
Inherits Class1
Public Const ConstString As String = ("hello2")

And the code:
   Dim i As Integer
   Dim e As Class1
   For i = 1 To 2
     If i = 1 Then
       e = New Class1
     Else
       e = New Class2
     End If
     Print e.ConstString
   Next


5) Explain clearly how to reproduce the bug or the crash.
Mark the project as translatable, and translate the string "hello2".
The program will output:
hello
hello2
and NOT the translated version of hello2.

It is same problem when the base class has a translatable string, but the  
inherited marks the string as non-translatable.





More information about the User mailing list