Page 1 of 1

Bug with localization: (Os4 and WinUAE Os3.9)

Posted: Wed Nov 17, 2021 5:45 pm
by sinisrus
Hello,

I may have found a bug with the localization: (Os4 and WinUAE Os3.9)

French catalog file : (pixy.catalog) => the last StringsCats one still has a writing problem

Catalog file :

Code: Select all

; StringsCat$[0]
Non enregistré
; StringsCat$[1]
commerçe
; StringsCat$[2]
Vidéo
; StringsCat$[3]
Eté

Code: Select all

    def$ = {}
    def$[0] = "Unregistred"
    def$[1] = "Copyright 2016 - 2021 @"
    def$[2] = "VIDE"
    def$[3] = "VIDE"

    OpenCatalog("Pixy.catalog")
        
    ; If Hollywood.catalog is not available
    StringsCat$={}
    For k = 0 To listitems(def$)-1
    ;StringsCat$[k] = GetCatalogString(k, def$[k])
    StringsCat$[k] = ConvertStr(GetCatalogString(k, def$[k]),#ENCODING_AMIGA,#ENCODING_UTF8)
    Next
        
    CloseCatalog()

    For i=0 TO listitems(def$)-1
    debugprint(i,StringsCat$[i])
    NEXT

EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Bug with localization: (Os4 and WinUAE Os3.9)

Posted: Thu Nov 18, 2021 11:55 am
by jPV
Add a line change (empty line) at the end of the catalog file to make it work correctly. I've noticed this also with my programs, but I guess I've forgotten to report because it had an easy work-around :)

Re: Bug with localization: (Os4 and WinUAE Os3.9)

Posted: Thu Nov 18, 2021 3:44 pm
by sinisrus
@JPV

thanks, I have another solution I create a new string "EMPTY LINE" always last and I do not use it in the program

; StringsCat $ [4]
EMPTY LINE

Re: Bug with localization: (Os4 and WinUAE Os3.9)

Posted: Sat Nov 20, 2021 2:49 pm
by airsoftsoftwair
Nice catch! Fixed now.

Code: Select all

- Fix: The last entry in a catalog in Hollywood's platform-independent format was only handled correctly
  if it has a terminating newline character