[NTLK] Need info on multi-language support of Newton packages

NewtonTalk newtontalk at pda-soft.de
Sat Feb 26 14:54:08 PST 2022

Hi gang,

I'm currently working on localizing NewtTest since Silvain kindly translated
my texts into French. I'm aware of the compile-time functions
SetLocalizationFrame and LocObj, have tried them out, and they work
flawlessly. The problem is that the Newton Toolkit will use this info at
compile time. If you e. g. tell it you want a French version, it will
COMPILE a French version. The up side is that you can compile all languages
without having to change your code or replace text files. The down side is
that you need to provide as many different packages of basically the same
program as you support languages. Which in my opinion isn't all that smart.
It would be much smarter to control those languages at runtime. That would
not only allow you to set the language automatically to that of the Newton's
ROM when your program is started, it would also allow users to choose their
favorite language at runtime.

While I've been contemplating this, I've realized that I have never in my
whole life seen a Newton package that does in fact come in the form of a
separate package for each language. Come to think of it, I've NEVER seen a
Newton package come in more than one incarnation (unless they're different
versions, of course) AT ALL. Since I can't imagine that Newton packages have
never supported more than one language, I'm wondering if I might be missing
something here. I've searched the following documents up and down in vain:

    Class-based NewtonScript Programming.pdf
    Newton 2.0 User Interface Guidelines.pdf
    Newton Formats 1.1.pdf
    Newton Internet Enabler Users Manual.pdf
    Newton OS 2.1 Engineering Documents.pdf
    Newton Programmers Guide.pdf
    Newton Programmers Reference.pdf
    Newton Toolkit File Formats.pdf
    Newton Toolkit User's Guide.pdf
    Newton Toolkit WinNTK Enhancements.pdf

Most of them mention SetLocalizationFrame and LocObj. None of them mentions
any alternative.

It is, of course, not rocket science to provide more than one set of strings
within your package, use the correct ones for initializing your user
interface and allow them to be switched on request. The problem with this
approach is that you would need all supported languages "on board", which
would increase the package size in a way that your program might no longer
fit in the little available RAM that e. g. an OMP has. It would be much
smarter to support language sets that can be installed as separate packages.
This can probably be hand-coded using soups, store parts and other stuff,
but somehow I'd be thinking I'm reinventing the wheel. 

What is your experience with the software you're using? Are there packages
out there where you can change the language at runtime? Have you ever coded
something like this yourself in NewtonScript?

Thanks, as usual


-- Newton software and hardware at http://www.pda-soft.de

More information about the NewtonTalk mailing list