Page 6 of 20

Re: translate kolibri

Posted: Wed Feb 20, 2013 6:15 pm
by stefano
What encoding I have to use?

Re: translate kolibri

Posted: Wed Feb 20, 2013 6:29 pm
by SoUrcerer
Select appropriate http://www.ascii-codes.com/
Note that we use CP866 in files with russian letters, that's why text strings are located in different files.

Re: translate kolibri

Posted: Wed Feb 20, 2013 6:35 pm
by stefano
Ok.

translating c4

Posted: Fri Apr 26, 2013 6:37 pm
by fedesco
HI, it has been a while since I translated last time.

I've updated my svn local copy and made some change, now I'm trying to translate the game c4, it's not that difficult, but I've some issue with the compilation.

Looking at 15, arcanoid & arcanni the language was specified throug an external file: lang.inc, and I tried to do the same thing with this program.

1st difference: I had to compile it with nasm and not fasm
I'm not an assembler programmer, but what does it implies? Isn't the language the same?

2nd difference:
in the other source codes external file where added with the " include 'filename' " command, in this programm they are added with the " %include 'filename' " command.
Again, why this difference and what does it imply?


I created the lang.inc file and made some tries including the file with the two commands specified above, (I've made no other difference), but I can't compile the source code anymore:
1st attempt:
include 'lang.inc'
error:
c4.asm:24: error: parser: instruction expected
make: *** [it] Error 1

%include 'lang.inc'
error:
lang.inc:1: error: parser: instruction expected
make: *** [it] Error 1

how should I proceed? What I'm trying to obtain is a lang variable, so that I can write some if-else statements.


update, ok, i managed to add the language variable, the fil lang has to be something like: lang equ 'it'
and not lang fix it

but how do I write an if-else statement?

with

Code: Select all

if lang equ 'it'
        db	"Nuova partita",0
    else
        db	"New game",0
    end if
i obtain the following error:

Code: Select all

c4.asm:768: error: parser: instruction expected
c4.asm:772: error: parser: instruction expected
c4.asm:917: error: symbol `end' redefined
make: *** [it] Error 1

thanks in advance!

Re: translating c4

Posted: Fri Apr 26, 2013 8:39 pm
by Mario_r4
fedesco wrote: 1st difference: I had to compile it with nasm and not fasm
I'm not an assembler programmer, but what does it implies? Isn't the language the same?
FASM
http://it.wikipedia.org/wiki/FASM
http://en.wikipedia.org/wiki/Fasm

NASM
http://it.wikipedia.org/wiki/NASM_(informatica)
http://en.wikipedia.org/wiki/Netwide_Assembler

It's different compilers Assembler. Each of them has its advantages and disadvantages. If the program is written using NASM syntax, then it can not be compiled with the compiler FASM without changes. You can change the code so that the compiler can understand it, but it takes time and extra effort.

As for your next question - is already syntaxis that uses NASM and need to read the documentation for the compiler.

Re: translate kolibri

Posted: Fri Apr 26, 2013 9:00 pm
by 0CodErr
Try this with NASM:

Code: Select all

%define lang  'it'

%if lang = 'it'
        db   "Nuova partita",0
%else
        db   "New game",0
%endif

Re: translate kolibri

Posted: Sat Apr 27, 2013 11:11 am
by fedesco
ok, thank you very much for your response, i've compiled the program successfully with the translation, but I have still a problem.

In italian some expression are longer in englihs (i mean that the string of character are longer), and the box designed for the program are not long enough, i've attached a screenshot.

Is it ok if I simply upload the program with the translation and someone else tries to fix it (redesign partially the application) or should I try to fix it? I fear it's a little bit to much for me, I've tried to do something, but... it didnt really work

In the image you can't for example read "Nuova partita" ("new game"), but only "nuova par" or "giocatore x", but only "giocatore" ("player x", where x is 1 or 2) and "CPU livello x" but only "lo x" ("cpu level x", where x is 1, ... , 8 )

Re: translate kolibri

Posted: Sat Apr 27, 2013 11:44 am
by Wildwest
probably you can change the design in the same way in c4.asm like

%if lang = 'it'
LABEL_PL1TYPE_X equ (LABEL_PL1_X + 10*10)
%else
LABEL_PL1TYPE_X equ (LABEL_PL1_X + 10*6)
%endif

Re: translate kolibri

Posted: Sat Apr 27, 2013 12:57 pm
by 0CodErr
In c4.asm:
Spoiler:

Code: Select all

; button dimensions

;..........................

%if lang = 'it'
	      BUTTON_NEW_WIDTH equ 56 + 28			
%else
	      BUTTON_NEW_WIDTH equ 56			
%endif

;..........................

; label dimensions
%if lang = 'it'
	      LABEL_PL1_X		equ	90 + 10			
%else
	      LABEL_PL1_X		equ	90		
%endif

;..........................

%if lang = 'it'
        LABEL_PL1TYPE_X		equ	(LABEL_PL1_X + 10*6 - 4)	
%else
        LABEL_PL1TYPE_X		equ	(LABEL_PL1_X + 10*6)		
%endif

;..........................

label_pl1type:
istruc LABEL
	at LABEL.position
	
%if lang = 'it'
	dd MOS_DWORD(LABEL_PL1TYPE_X + 18,LABEL_PL1TYPE_Y)
%else
	dd MOS_DWORD(LABEL_PL1TYPE_X,LABEL_PL1TYPE_Y)
%endif	

	dd playertypes+PL1TYPE_INIT*PLAYERTYPELEN
	dd MOS_RGB(255,255,255)
	dd MOS_RGB(0,0,0)
iend
label_pl2type:
istruc LABEL
	at LABEL.position
	
%if lang = 'it'
	dd MOS_DWORD(LABEL_PL2TYPE_X + 18,LABEL_PL2TYPE_Y)
%else
	dd MOS_DWORD(LABEL_PL2TYPE_X,LABEL_PL2TYPE_Y)
%endif		
	
	dd playertypes+PL2TYPE_INIT*PLAYERTYPELEN
	dd MOS_RGB(255,255,255)
	dd MOS_RGB(0,0,0)
iend
Spoiler:Image

Re: translate kolibri

Posted: Sat Apr 27, 2013 1:27 pm
by fedesco
Ok, thank you very much for the help, but I still have some problem with the dimension of the images, probably I forgot something, even if I checked the code more times, I'll attach it...

Again; thank you very much!

Re: translate kolibri

Posted: Sun May 05, 2013 9:19 am
by fedesco
Ok, somehow I managed to solve the issue with spacing an the languages, thank you very much

Re: translate kolibri

Posted: Tue May 28, 2013 6:10 pm
by SoUrcerer
Now kernel sources are in UTF; binary still uses 1-byte codepages. You can change message encodings use FASM macros.

Re: translate kolibri

Posted: Tue May 28, 2013 9:00 pm
by stefano
SoUrcerer wrote:Now kernel sources are in UTF; binary still uses 1-byte codepages. You can change message encodings use FASM macros.
Seriously? That is a great news!

Re: translate kolibri

Posted: Tue May 28, 2013 9:04 pm
by SoUrcerer
Yeah. USB stack in trunk now too, and may be even network branch

Re: translate kolibri

Posted: Tue May 28, 2013 9:06 pm
by stefano
Good work SoUrcerer!