View Full Version : BASIC in another language?
tezza
April 14th, 2008, 11:00 AM
Reading about the Swedish Luxor on the web got me thinking about computers manufactured for and by countries whose 1st language is not English. I thought about BASIC and how popular it was, even in these "locally-made" computers.
This lead to another thought. The commands and keywords in BASIC are essentially English words. Were any versions of BASIC written for these "local" machines where the keywords themselves were in the country's native language. In other words, were words like PRINT, INPUT, CLEAR, LET, POKE etc, ever substituted with local language alternatives?
carlsson
April 14th, 2008, 10:21 PM
Sometimes yes, but more as a proof of concept than practically used. Even though the keywords are based on English, they still are commands - not sentences. I don't know about the ABC computers, but I've seen a hacked Basic for the C64 which translates keywords one by one. Thanks to being a tokenized language, programs will still run (but be harder to type in or change).
MikeS
April 14th, 2008, 10:40 PM
<snip>
Thanks to being a tokenized language, programs will still run (but be harder to type in or change).
----
Why would it be any different in a different language? As you say, the tokenized program wouldn't be affected, but you could presumably put whatever words you like into the corresponding keyword table. You might have trouble finding equivalent words in other languages though; quick, what's peek & poke in Swedish?
I kinda like Fenster instead of Window for the Germans among us though...
mike
CP/M User
April 14th, 2008, 11:35 PM
There's a BASIC language out there which uses the American form of "Color" - I'm unsure though there maybe a slight chance that the machine was made in the UK!? Though it was probably one of those machines made in the UK as well as America (usually the machines have different names though!)
paul.brett
April 15th, 2008, 01:42 AM
There's a BASIC language out there which uses the American form of "Color"
I thought they ALL used the American version. And by American version, I do mean 'wrong' of course.
:D
Paul.
tezza
April 15th, 2008, 01:49 AM
I think most extended BASICS do use the American spelling i.e. COLOR. However this is not true of all. My EACA Colour Genie (manufactured in Hong Kong) uses the command "COLOUR".
Tez
carlsson
April 15th, 2008, 04:25 AM
Why would it be any different in a different language?
If the program was stored as ASCII and the Basic needs to interpret every line, every command, every time the program is executed, a Basic program written in English would result in ?SYNTAX ERROR on a computer with a German, French, Swedish, Italian, Japanese etc Basic interpreter. Currently I own one computer (video game) that stores its Basic programs as ASCII, the vTech creatiVision. I don't know how other video games with Basic extentions did.
A program that you load from tape or disk in tokenized form, the Basic dialect only needs to translate tokens to keywords in one direction when you LIST it, and vice versa if you'd like to add or change anything to the listing.
Imagine this program written by an English speaking person:
10 FOR I=1 TO 10
15 PRINT "HELLO NR ";I
20 NEXT I
When displayed on a Swedish computer, it may look like this:
10 FÖR I=1 TILL 10
15 SKRIV "HELLO NR ";I
20 NÄSTA I
Now, if I want to flash the border colour, I might add a line like this:
12 FÄRG 0,I : REM made-up syntax
If I save this program and you load it back on your English computer, the program supposedly looks like this:
10 FOR I=1 TO 10
12 COLOR 0,I
15 PRINT "HELLO NR ";I
20 NEXT I
because the token (and syntax) for FÄRG and COLOR is the same. If our Basics had not been tokenized, neither of us would've been able to share programs with eachother although the computer models were the same. Actually I believe this is/was partly true with Microsoft Excel VB scripts: some of its commands were stored literally and then translated, so some macros written in English-speaking Excel wouldn't run in the Swedish-speaking version of the same program.
peek & poke in Swedish?
I'm not sure. Does POKE come from when you poke someone in the eye? I've heard people talk about "peta in" values to memory addresses, but that is not official language.
By the way, doesn't the BBC Micro's Basic use British spelling of COLOUR?
Zeela
April 15th, 2008, 04:51 AM
Actually I believe this is/was partly true with Microsoft Excel VB scripts: some of its commands were stored literally and then translated, so some macros written in English-speaking Excel wouldn't run in the Swedish-speaking version of the same program.Yes, VBA (Visual Basic for Applications) in early MS Office versions did have the possibility of using your local language as script language. All keywords in the language were tokenized so they worked well. But no built-in functions were tokenized. So if you used a function like DLookup (DSlåUpp in swedish) in Access it would be stored literary. But the english names of the functions always worked (even in the swedish Access etc). It was when you used the localized versions you got in trouble. Then the english version of Access wouldn't like it at all.
// Z
dongfeng
April 15th, 2008, 06:11 AM
By the way, doesn't the BBC Micro's Basic use British spelling of COLOUR?
I think so, but I have a feeling that both spellings worked...
Dwight Elvey
April 15th, 2008, 06:58 AM
Hi
Not all languages have to come with any specific language.
It is quite trivial to alias all of Forth's words to most any
language that can be entered as characters.
Dwight
tezza
April 15th, 2008, 03:20 PM
I'm not sure. Does POKE come from when you poke someone in the eye?
In more general terms the word "poke" in English can also be used as a verb to refer to pushing something into an enclosed space (normally with your finger). It is this meaning that lead to it's use in BASIC I imagine, as you are pushing a number into a memory location.
Tez
carlsson
April 15th, 2008, 04:02 PM
Yes, of course. I suppose PETA still is the closest translation. As for PEEK, I'd suggest KIKA. That is another interesting aspect when you translate a programming language, how much room you have for keywords. The Swedish C64 Basic I've seen came up with a bunch of rather interesting solutions whenever the keyword area was not big enough. For example GO TO should be translated as "GÅ TILL", which is a few characters too many. Instead whoever made the translation chose to rename the command @. Yes, something like this:
10 SKRIV"HELLO"
20 @10
... no, the @ sign is not part of the Swedish alphabet.
Ksarul
April 15th, 2008, 06:42 PM
I haven't seen localized versions of BASIC, but I have seen localized versions of LOGO. I've seen that one in German, French, Italian, Dutch, and Spanish, with support built into the core for several additional European languages. All of these localized versions were for the 99/4A though.
carlsson
April 15th, 2008, 11:35 PM
I have an introduction to computing published by Texas Instruments Sweden. It is a cross between an advertisment and an instruction book, which mentions LOGO among other stuff. However the version described in the booklet clearly uses English keywords for the built-in primitives. I don't know if that is a sign whether or not TI localized LOGO to Swedish as well.
Ksarul
April 18th, 2008, 01:19 PM
Swedish was one of the languages for LOGO they had listed, though I've never seen a cartridge or a dump of one that was localized to it. The versions that were localized used a different set of GROMs than the regular ones--but one of them was common to all localized versions, and that was where the language selection list was. Only the correct localized language would be displayed as a choice on the title screen though, not all 12.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.