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

Report any Hollywood bugs here
Post Reply
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

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

Post 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
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

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

Post 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 :)
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

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

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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
Post Reply