[NTLK] Need info on multi-language support of Newton packages
Matthias Melcher
m.melcher at robowerk.de
Sat Feb 26 17:33:42 PST 2022
> On 26. Feb 2022, at 23:54, NewtonTalk <newtontalk at pda-soft.de> wrote:
> 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.
Internationalisation was not so much a thing in 1994 when NewtonOS was written. Also, keeping the package size small, is one of the things that's pounded on throughout the documentation.
> It would be much smarter to support language sets that can be installed as separate packages.
Yes, that should work. You can reference those with smart pointers as far as I remember. I am not exactly sure how that is done, but you can export MPs from one package taht another package can then reference. This is really helpful for your purpose, because loading another language package will automatically change all references. That keeps you from writing code like this:
if lang==d print("Hallo")
else if lang==e print("Hello")
else if lang==f print("Bonjour")
which gets very tiring.
You can also write a new language pack without touching the original program again.
You can put multiple parts into one package. So you can have the program part and the language part. I am not sure how they could reference each other, or if you can have multiple language parts, but it may be an alternative option.
I am sure you know that `Gestalt(ROMStage)` will return the language of the current machine.
Hope that helps,
- Matthias
More information about the NewtonTalk
mailing list