Jump to content
IGNORED

CC65: Is there a method to use more than 1 language/character set in an app? (gettext, internationalization)


scottinNH

Recommended Posts

What options are there to support internationalization in CC65?

 

Let's say you find a text utility in Polish, and you want to update the codebase to also support English (or the reverse language flow).

 

Has anyone seen an example/demo in C that handles this in any way? I'm guessing there's 2 ways to approach this.

i) A codebase that selects which language to compile to, using #defines.

ii) On Linux I've used GNU gettext(), but that approach immediately feels heavy (and in any case, it wouldn't automatically handle different character sets).

 

Looking for a suggestion how this has been done, or a link to some code that does this.  Cheers all.

 

 

 

Edited by scottinNH
Link to comment
Share on other sites

If I was going about trying to support internationalization, from a font perspective, I'd probably look at copying the OS to RAM and then overwriting the default OS font.  You can also load your custom font into any 1k aligned memory region and tell the OS to go to that region for font data.  The benefit of loading the OS into RAM is that you can basically overwrite any part of the OS you won't be needing.  You'll need to practice some care here but there are significant chunks of RAM you can free up in this way (say the floating point routines, the international character set data in XL/XE machines, the cassette driver, etc.).

 

In any event then I'd be able to deploy one binary with several 1k font files allowing the user to select their language at runtime (saving their selection for future runs).  There are plenty of source code examples out there of loading custom fonts.

  • Like 1
Link to comment
Share on other sites

Is there an index of all the Atari OS ROMS, OR (better still) is there an index of all Atari character sets (in byte or some other format)?

...if I know "which" ROMs to extract character sets from, I should be able to, at least one to start.

 

To put together a demo/example that switches between say Polish, and English + French, it looks like I'd need to:

  1. Download Eastern Europe ROM
  2. Extract character set somehow (the location will be the same, but I'll need to learn what tool is best for this)
  3. Embed this character set into the code, then make that character set active (I did this long ago in BASIC with a USR() machine function)
  4. Invoke localized print strings using that alternate character set

This sounds very doable, and seems like it could be "switched between" either at compile time (#defines) or dynamically (costing 1K per character set)

 

Going to try this as described above; if any blanks can be filled in that'd help.  I need to pivot to another task but I'll be back with results.

Edited by scottinNH
Link to comment
Share on other sites

 

I think everyone has covered it.  But, when I was still interested in Cyrillic, it was just a matter of re-defining the characters and using it.

 

Half way down the page, some code on how that picture was done.  basically loads a new font to memory to overwrite the one that came from rom - then understand that "#hfqdth" now means драйвер. for example.

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...