Feature request - Accept spelling 'centre' to call function 'center'

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Feature request - Accept spelling 'centre' to call function 'center'

alexgibson
Hi, a really simple request which I hope would be trivial for one of the awesome OpenSCAD devs to implement please!

Please allow use of spelling 'centre' interchangeably with 'center' in OpenSCAD scripts.

Usage:

     cylinder(10,15,15,centre=true);

The reason for this is that in British English (I'm English), but also Australian, Canadian and other non-US English varieties, centre is the correct spelling.  Of course we can adapt to typing 'center' but it is really easy to revert to 'centre' accidentally and it's annoying when the render fails because of this 'mistake'.

I'd be very grateful, and I imagine other users outside of the US would appreciate this too!

If there is any work to translate OpenSCAD into other languages, I would be glad to help and could translate sections into French.
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

Miro Hrončok
I haven't seen any programming language, where this is possible. If this is ever going to be implemented, a warning should be displayed when using centre.

Miro Hrončok

Telefon: +420777974800


2014-01-29 alexgibson <[hidden email]>
Hi, a really simple request which I hope would be trivial for one of the
awesome OpenSCAD devs to implement please!

Please allow use of spelling 'centre' interchangeably with 'center' in
OpenSCAD scripts.

Usage:

     cylinder(10,15,15,centre=true);

The reason for this is that in British English (I'm English), but also
Australian, Canadian and other non-US English varieties, centre is the
correct spelling.  Of course we can adapt to typing 'center' but it is
really easy to revert to 'centre' accidentally and it's annoying when the
render fails because of this 'mistake'.

I'd be very grateful, and I imagine other users outside of the US would
appreciate this too!

If there is any work to translate OpenSCAD into other languages, I would be
glad to help and could translate sections into French.



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

PolyVinalDistillate
The same could be said of 'color' being spelled as 'colour'. I've definitely seen one programming language that allowed interchangeable use of color or colour, but can't remember what it was now! Anyway, it has irritated me from the very start of my programming days on a BBC Micro that they didn't spell colour right, and I can see the same problem with centre. Unfortunately us brits don't usually get to have a programming language that matches *our* spelling, because there's a far larger number of 'english' speakers churning out software over in America. Oh it would be nice to make them all spell properly and fix their accents ( :p to all you Americans reading this!), but sadly I fear it is too late.

I'd be tempted to request a '#define' directive or similar (if there's not one already) to allow us to define equivalents so those of us that get frustrated have a workaround. Personally, however, I long became resigned to the fact that the developers of programming languages often can't spell, and the ones that can have to fit in with the myriad of ones that couldn't and who came before them.

I'm just pleased Aluminium isn't a keyword...
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

nophead
I vote for this as well as it is very hard to type color and center when you are as old as me and spent the rest of your life spelling them correctly. I.e. when I type colour I just think of the concept and my fingers automatically type it, I don't think in letters. I then get an error and have to correct it. Centre is worse because you don't even get an error. It do use it far more often though, so tend to think of it as a special word for OpenScad. A bit like using square to mean rectangle.

I am surprised it uses the US spelling as I thought the original authors were Austrian. Do Austrians and other Europeans learn US English when they learn English?


On 29 January 2014 11:30, PolyVinalDistillate <[hidden email]> wrote:
The same could be said of 'color' being spelled as 'colour'. I've definitely
seen one programming language that allowed interchangeable use of color or
colour, but can't remember what it was now! Anyway, it has irritated me from
the very start of my programming days on a BBC Micro that they didn't spell
colour right, and I can see the same problem with centre. Unfortunately us
brits don't usually get to have a programming language that matches *our*
spelling, because there's a far larger number of 'english' speakers churning
out software over in America. Oh it would be nice to make them all spell
properly and fix their accents ( :p to all you Americans reading this!), but
sadly I fear it is too late.

I'd be tempted to request a '#define' directive or similar (if there's not
one already) to allow us to define equivalents so those of us that get
frustrated have a workaround. Personally, however, I long became resigned to
the fact that the developers of programming languages often can't spell, and
the ones that can have to fit in with the myriad of ones that couldn't and
who came before them.

I'm just pleased Aluminium isn't a keyword...



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6699.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

szabi
No, in Austria you learn BE, but the overwhelming majority of programming languages uses AE, and therefore, if you want acceptance for your product, it's easier to swim with the current.

Having different parameter names accepted is, actually, the same problem as translating the keywords. (so I'm against alternative spellings)

Though better errors/warnings would be definitely welcome.



Szelp, André Szabolcs

+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 12:56 PM, nop head <[hidden email]> wrote:
I vote for this as well as it is very hard to type color and center when you are as old as me and spent the rest of your life spelling them correctly. I.e. when I type colour I just think of the concept and my fingers automatically type it, I don't think in letters. I then get an error and have to correct it. Centre is worse because you don't even get an error. It do use it far more often though, so tend to think of it as a special word for OpenScad. A bit like using square to mean rectangle.

I am surprised it uses the US spelling as I thought the original authors were Austrian. Do Austrians and other Europeans learn US English when they learn English?


On 29 January 2014 11:30, PolyVinalDistillate <[hidden email]> wrote:
The same could be said of 'color' being spelled as 'colour'. I've definitely
seen one programming language that allowed interchangeable use of color or
colour, but can't remember what it was now! Anyway, it has irritated me from
the very start of my programming days on a BBC Micro that they didn't spell
colour right, and I can see the same problem with centre. Unfortunately us
brits don't usually get to have a programming language that matches *our*
spelling, because there's a far larger number of 'english' speakers churning
out software over in America. Oh it would be nice to make them all spell
properly and fix their accents ( :p to all you Americans reading this!), but
sadly I fear it is too late.

I'd be tempted to request a '#define' directive or similar (if there's not
one already) to allow us to define equivalents so those of us that get
frustrated have a workaround. Personally, however, I long became resigned to
the fact that the developers of programming languages often can't spell, and
the ones that can have to fit in with the myriad of ones that couldn't and
who came before them.

I'm just pleased Aluminium isn't a keyword...



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6699.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

nophead
I don't see how it causes the same problem as translated keywords as everybody that can read English can read them. The only problem would be later scripts not accepted by earlier OpenScad versions, but that is generally the case anyway.


On 29 January 2014 12:17, Szelp, A. Sz. <[hidden email]> wrote:
No, in Austria you learn BE, but the overwhelming majority of programming languages uses AE, and therefore, if you want acceptance for your product, it's easier to swim with the current.

Having different parameter names accepted is, actually, the same problem as translating the keywords. (so I'm against alternative spellings)

Though better errors/warnings would be definitely welcome.



Szelp, André Szabolcs

<a href="tel:%2B43%20%28650%29%2079%2022%20400" value="+436507922400" target="_blank">+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 12:56 PM, nop head <[hidden email]> wrote:
I vote for this as well as it is very hard to type color and center when you are as old as me and spent the rest of your life spelling them correctly. I.e. when I type colour I just think of the concept and my fingers automatically type it, I don't think in letters. I then get an error and have to correct it. Centre is worse because you don't even get an error. It do use it far more often though, so tend to think of it as a special word for OpenScad. A bit like using square to mean rectangle.

I am surprised it uses the US spelling as I thought the original authors were Austrian. Do Austrians and other Europeans learn US English when they learn English?


On 29 January 2014 11:30, PolyVinalDistillate <[hidden email]> wrote:
The same could be said of 'color' being spelled as 'colour'. I've definitely
seen one programming language that allowed interchangeable use of color or
colour, but can't remember what it was now! Anyway, it has irritated me from
the very start of my programming days on a BBC Micro that they didn't spell
colour right, and I can see the same problem with centre. Unfortunately us
brits don't usually get to have a programming language that matches *our*
spelling, because there's a far larger number of 'english' speakers churning
out software over in America. Oh it would be nice to make them all spell
properly and fix their accents ( :p to all you Americans reading this!), but
sadly I fear it is too late.

I'd be tempted to request a '#define' directive or similar (if there's not
one already) to allow us to define equivalents so those of us that get
frustrated have a workaround. Personally, however, I long became resigned to
the fact that the developers of programming languages often can't spell, and
the ones that can have to fit in with the myriad of ones that couldn't and
who came before them.

I'm just pleased Aluminium isn't a keyword...



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6699.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

szabi
Yeah, but you kind of open the box of pandora. If you say, it's not a problem, because " everybody that can read English can read them" an Italian could come and ask to enable "colore" as well, after all, it's still not too different and "everybody that can read  English can understand it as well". Then comes the Frenchman, "couleur" is not too different either and can be understood. Oh, and the Romanian "culoare" neither. Even basque (which is not a Romance language, for a matter of fact) could come with "kolorea" or the Cebuano (a native language of the Philippines) with "kolor". With such a variation and 6 langauges the question arises why not allow other "translated" parameter names?

It really is a question whether you want to go down that way. And whether you want to be faced with allegations of discrimination and cultural bias, where you allow for Anglo-Saxon variants, but not other.

Szelp, André Szabolcs

+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 1:59 PM, nop head <[hidden email]> wrote:
I don't see how it causes the same problem as translated keywords as everybody that can read English can read them. The only problem would be later scripts not accepted by earlier OpenScad versions, but that is generally the case anyway.


On 29 January 2014 12:17, Szelp, A. Sz. <[hidden email]> wrote:
No, in Austria you learn BE, but the overwhelming majority of programming languages uses AE, and therefore, if you want acceptance for your product, it's easier to swim with the current.

Having different parameter names accepted is, actually, the same problem as translating the keywords. (so I'm against alternative spellings)

Though better errors/warnings would be definitely welcome.



Szelp, André Szabolcs

<a href="tel:%2B43%20%28650%29%2079%2022%20400" value="+436507922400" target="_blank">+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 12:56 PM, nop head <[hidden email]> wrote:
I vote for this as well as it is very hard to type color and center when you are as old as me and spent the rest of your life spelling them correctly. I.e. when I type colour I just think of the concept and my fingers automatically type it, I don't think in letters. I then get an error and have to correct it. Centre is worse because you don't even get an error. It do use it far more often though, so tend to think of it as a special word for OpenScad. A bit like using square to mean rectangle.

I am surprised it uses the US spelling as I thought the original authors were Austrian. Do Austrians and other Europeans learn US English when they learn English?


On 29 January 2014 11:30, PolyVinalDistillate <[hidden email]> wrote:
The same could be said of 'color' being spelled as 'colour'. I've definitely
seen one programming language that allowed interchangeable use of color or
colour, but can't remember what it was now! Anyway, it has irritated me from
the very start of my programming days on a BBC Micro that they didn't spell
colour right, and I can see the same problem with centre. Unfortunately us
brits don't usually get to have a programming language that matches *our*
spelling, because there's a far larger number of 'english' speakers churning
out software over in America. Oh it would be nice to make them all spell
properly and fix their accents ( :p to all you Americans reading this!), but
sadly I fear it is too late.

I'd be tempted to request a '#define' directive or similar (if there's not
one already) to allow us to define equivalents so those of us that get
frustrated have a workaround. Personally, however, I long became resigned to
the fact that the developers of programming languages often can't spell, and
the ones that can have to fit in with the myriad of ones that couldn't and
who came before them.

I'm just pleased Aluminium isn't a keyword...



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6699.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

RE: Feature request - Accept spelling 'centre' to call function 'center'

alexgibson
In reply to this post by nophead
Hi Nop Head et al,

Thanks for taking it seriously.

For me it's about usability, in this case for native English speakers
outside of the US avoiding wasted time 'debugging', nothing to do with
imposing 'correctness' of language.  I forgot the most annoying thing -
that often OpenSCAD will simply ignore an 'incorrect' spelling - this is
awful as when I try to debug, 'centre' does not leap out as being wrong
- it isn't!

I am curious as to whether there are really any unintended consequences
to adding extra names for the same parameter?  I can understand a
programmer's desire to keep things as simple as possible but is there a
real risk?

About the only issue I can see with this is backwards compatibility -
running new scripts on old versions of OpenSCAD.  However, firstly, when
is this a necessary thing to do?  And secondly, if you really want to
use an old OpenSCAD and have a script with alternative names for
functions, a simple 'search and replace' which could be done in anything
from Microsoft word to a Linux shell script, would be able to translate
the code to US English again.

Seems like a simple idea would be a translation table for functions into
multiple languages - I would be delighted to immediately provide
translations of all function names for British English, Italian, French,
German and Norwegian if anyone would be willing to code it into a
version of OpenSCAD - let's try it!

> -------- Original Message --------
> Subject: Re: Feature request - Accept spelling 'centre' to call function
> 'center'
> From: "nop head [via OpenSCAD]" <[hidden email]>
> Date: Wed, January 29, 2014 12:59 pm
> To: alexgibson <[hidden email]>
>
>
> I don't see how it causes the same problem as translated keywords as
> everybody that can read English can read them. The only problem would be
> later scripts not accepted by earlier OpenScad versions, but that is
> generally the case anyway.
>
>
> On 29 January 2014 12:17, Szelp, A. Sz. <[hidden email]> wrote:
>
> > No, in Austria you learn BE, but the overwhelming majority of programming
> > languages uses AE, and therefore, if you want acceptance for your product,
> > it's easier to swim with the current.
> >
> > Having different parameter names accepted is, actually, the same problem
> > as translating the keywords. (so I'm against alternative spellings)
> >
> > Though better errors/warnings would be definitely welcome.
> >
> >
> >
> > Szelp, André Szabolcs
> >
> > +43 (650) 79 22 400
> >
> >
> > On Wed, Jan 29, 2014 at 12:56 PM, nop head <[hidden email]> wrote:
> >
> >> I vote for this as well as it is very hard to type color and center when
> >> you are as old as me and spent the rest of your life spelling them
> >> correctly. I.e. when I type colour I just think of the concept and my
> >> fingers automatically type it, I don't think in letters. I then get an
> >> error and have to correct it. Centre is worse because you don't even get an
> >> error. It do use it far more often though, so tend to think of it as a
> >> special word for OpenScad. A bit like using square to mean rectangle.
> >>
> >> I am surprised it uses the US spelling as I thought the original authors
> >> were Austrian. Do Austrians and other Europeans learn US English when they
> >> learn English?
> >>
> >>
> >> On 29 January 2014 11:30, PolyVinalDistillate <
> >> [hidden email]> wrote:
> >>
> >>> The same could be said of 'color' being spelled as 'colour'. I've
> >>> definitely
> >>> seen one programming language that allowed interchangeable use of color
> >>> or
> >>> colour, but can't remember what it was now! Anyway, it has irritated me
> >>> from
> >>> the very start of my programming days on a BBC Micro that they didn't
> >>> spell
> >>> colour right, and I can see the same problem with centre. Unfortunately
> >>> us
> >>> brits don't usually get to have a programming language that matches *our*
> >>> spelling, because there's a far larger number of 'english' speakers
> >>> churning
> >>> out software over in America. Oh it would be nice to make them all spell
> >>> properly and fix their accents ( :p to all you Americans reading this!),
> >>> but
> >>> sadly I fear it is too late.
> >>>
> >>> I'd be tempted to request a '#define' directive or similar (if there's
> >>> not
> >>> one already) to allow us to define equivalents so those of us that get
> >>> frustrated have a workaround. Personally, however, I long became
> >>> resigned to
> >>> the fact that the developers of programming languages often can't spell,
> >>> and
> >>> the ones that can have to fit in with the myriad of ones that couldn't
> >>> and
> >>> who came before them.
> >>>
> >>> I'm just pleased Aluminium isn't a keyword...
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>> http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6699.html
> >>> Sent from the OpenSCAD mailing list archive at Nabble.com.
> >>> _______________________________________________
> >>> OpenSCAD mailing list
> >>> [hidden email]
> >>> http://rocklinux.net/mailman/listinfo/openscad
> >>> http://openscad.org - https://flattr.com/thing/121566
> >>>
> >>
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> [hidden email]
> >> http://rocklinux.net/mailman/listinfo/openscad
> >> http://openscad.org - https://flattr.com/thing/121566
> >>
> >
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > [hidden email]
> > http://rocklinux.net/mailman/listinfo/openscad
> > http://openscad.org - https://flattr.com/thing/121566
> >
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6702.html
>
> To unsubscribe from Feature request - Accept spelling 'centre' to call function 'center', visit
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

Miro Hrončok
> Seems like a simple idea would be a translation table for functions into
> multiple languages - I would be delighted to immediately provide
> translations of all function names for British English, Italian, French,
> German and Norwegian if anyone would be willing to code it into a
> version of OpenSCAD - let's try it!

This was already proposed and the discussion is another thread. However, pleas don't. Just don't.

Miro Hrončok

Telefon: +420777974800

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

PolyVinalDistillate
I'm still learning how quoting works.. sorry if this goes wrong...

Miro Hrončok wrote
> Seems like a simple idea would be a translation table for functions into
> multiple languages - I would be delighted to immediately provide
> translations of all function names for British English, Italian, French,
> German and Norwegian if anyone would be willing to code it into a
> version of OpenSCAD - let's try it!

This was already proposed and the discussion is another thread. However,
pleas don't. Just don't.
I agree - multiple-language versions of all keywords in OpenSCAD would lead to nightmares when it came to searching for a specific library, etc, on the web. Not only do you have to identify a library that does what you want, but you have to figure out what language it is in first to test it, and hope it does EXACTLY what you want because there's a good chance you won't understand a word of it!

There has been no further mention of the #define option I suggested... This leads me to believe I've either missed the existing #define function, or it was such an outrageously silly suggestion everyone has thought it better ignored! I'll admit it has it's own complications, like when using:

#define colour color

the preprocessing would need to allow replacement of:

colour([x, y, z])   with   color([x, y, z])

but not replace anything in:

colour1 = 50; (in case there was a color1 = 45 referring to a different variable).

however, this is just a matter of syntax... in the above case, treat brackets like spaces in the preprocessor replacement routines...

Another option could be a keyword like #aliasfxn, e.g. #aliasfxn colour color ?

This way people could cheerfully create illegible code if they so wished, but have to include a table of conversions in the form of #defines in a separate file so OpenSCAD can deal with it.
tp3
Reply | Threaded
Open this post in threaded view
|

RE: Feature request - Accept spelling 'centre' to call function 'center'

tp3
In reply to this post by alexgibson
alexgibson wrote
About the only issue I can see with this is backwards compatibility -
running new scripts on old versions of OpenSCAD.  However, firstly, when
is this a necessary thing to do?
Right, the important case is of cause the other way around. In the specific case center/color it's probably no issue because the current logic with different namespaces for variables and functions might resolve to the correct behavior (but I didn't really validate that). But in the general case, just think of a user having a variable colour which then would conflict with the new module called colour.
I think for colour and centre it might be ok, to just accept both. I would not see that as the same case as doing actual translation.

alexgibson wrote
Seems like a simple idea would be a translation table for functions into
multiple languages - I would be delighted to immediately provide
translations of all function names for British English, Italian, French,
German and Norwegian if anyone would be willing to code it into a
version of OpenSCAD - let's try it!
Please no. I've updated the code that was lying around for translation of the GUI (and possibly the error messages). We do have almost complete GUI translation files for German and Russian now. So if someone wants to have a look at other languages, that would be very welcome. I hope this code and the translations will make it into the next release (even though I'll probably stay with the English version instead of German).

But I really don't like the idea to have the scad language itself in different languages. I could image something in the editor which would do this kind of translations in the GUI layer only (but that's likely not too easy to do).
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

szabi
In reply to this post by PolyVinalDistillate
The issue with OpenScad not throwing an error when you pass an "undefined" parameter is, I was told, by design, such you can inject variables into the namespace. However, a Warning in this case would be very welcome! -- I had some time wasted with finding the bug when only a parameter was misspelled.

A kind of a "preprocessor" could be useful, but then again, you can write your own (e.g. one-line sed-script) and simply include it in your build environment (e.g. via make).



Szelp, André Szabolcs

+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 3:01 PM, PolyVinalDistillate <[hidden email]> wrote:
I'm still learning how quoting works.. sorry if this goes wrong...


Miro Hrončok wrote
>> Seems like a simple idea would be a translation table for functions into
>> multiple languages - I would be delighted to immediately provide
>> translations of all function names for British English, Italian, French,
>> German and Norwegian if anyone would be willing to code it into a
>> version of OpenSCAD - let's try it!
>
> This was already proposed and the discussion is another thread. However,
> pleas don't. Just don't.

I agree - multiple-language versions of all keywords in OpenSCAD would lead
to nightmares when it came to searching for a specific library, etc, on the
web. Not only do you have to identify a library that does what you want, but
you have to figure out what language it is in first to test it, and hope it
does EXACTLY what you want because there's a good chance you won't
understand a word of it!

There has been no further mention of the #define option I suggested... This
leads me to believe I've either missed the existing #define function, or it
was such an outrageously silly suggestion everyone has thought it better
ignored! I'll admit it has it's own complications, like when using:

#define colour color

the preprocessing would need to allow replacement of:

colour([x, y, z])   with   color([x, y, z])

but not replace anything in:

colour1 = 50; (in case there was a color1 = 45 referring to a different
variable).

however, this is just a matter of syntax... in the above case, treat
brackets like spaces in the preprocessor replacement routines...

Another option could be a keyword like #aliasfxn, e.g. #aliasfxn colour
color ?

This way people could cheerfully create illegible code if they so wished,
but have to include a table of conversions in the form of #defines in a
separate file so OpenSCAD can deal with it.



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6706.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

tp3
szabi wrote
A kind of a "preprocessor" could be useful, but then again, you can write
your own (e.g. one-line sed-script) and simply include it in your build
environment (e.g. via make).
Useful yes, but they also create lots of trouble that is hard to debug when just replacing text at some random unexpected places. In general I try to avoid them as much as possible.
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

PolyVinalDistillate
This post was updated on .
Edit: quote attribution (oops)

tp3 wrote
In general I try to avoid them as much as possible.
I have a friend whose mouth would drop open in horror at that statement but in many ways, I'm with you! A #define can be incredibly useful though... It's available in all languages I've used from raw assembly through to C++, but I suppose it can make more sense in that context.
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

szabi
In reply to this post by tp3
But that very argument (error-prone/complex if to be done properely) goes for a built-in preprocessor, so I understand why developers wouldn't pick up the request of the original poster and rather concentrate on other improvements.

Szelp, André Szabolcs

+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 3:58 PM, tp3 <[hidden email]> wrote:
szabi wrote
> A kind of a "preprocessor" could be useful, but then again, you can write
> your own (e.g. one-line sed-script) and simply include it in your build
> environment (e.g. via make).

Useful yes, but they also create lots of trouble that is hard to debug when
just replacing text at some random unexpected places. In general I try to
avoid them as much as possible.




-----
-- Torsten
--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6709.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

szabi
In reply to this post by PolyVinalDistillate
Actually, contratry to the attribution in your mail, it was tp3 who wrote "In general I try to avoid them as much as possible."

Szelp, André Szabolcs

+43 (650) 79 22 400


On Wed, Jan 29, 2014 at 4:03 PM, PolyVinalDistillate <[hidden email]> wrote:


szabi wrote
> In general I try to avoid them as much as possible.

I have a friend whose mouth would drop open in horror at that statement but
in may ways, I'm with you! A #define can be incredibly useful though... It's
available in all languages I've used from raw assembly through to C++, but I
suppose it can make more sense in that context.



--
View this message in context: http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-function-center-tp6697p6710.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

PolyVinalDistillate
szabi wrote
Actually, contratry to the attribution in your mail, it was tp3 who wrote
"In general I try to avoid them as much as possible."
 I think I got the quote above right this time... Apologies szabi! Have corrected the original post :)
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

David Eccles (gringer)
In reply to this post by alexgibson
From: PolyVinalDistillate <[hidden email]>
> The same could be said of 'color' being spelled as 'colour'. I've
definitely
> seen one programming language that allowed interchangeable use of color or
> colour, but can't remember what it was now! Anyway, it has irritated me
from
> the very start of my programming days on a BBC Micro that they didn't spell
> colour right, and I can see the same problem with centre. Unfortunately us
> brits don't usually get to have a programming language that matches *our*
> spelling, because there's a far larger number of 'english' speakers
churning
> out software over in America. Oh it would be nice to make them all spell
> properly and fix their accents ( :p to all you Americans reading this!),
but
> sadly I fear it is too late.

R was developed in part by people from Auckland, NZ, so they were aware of
spelling issues. They chose to use the keyword 'col', which is a prefix in
both US and 'everything else' English.

When I write scripts that take colour or centre as a parameter, I
generally accept both forms. For example, here's my "GetOptions" function
call that I use in my map generator script:

GetOptions($projOpts, 'lines!', 'key!', 'pointSize|psize=f',
'roundDP|round=i',
           'centre|center=s',
           'projection=s',
           'zoomed|zoom=s@',
           'colourTheme|color|colour=s', => \$colourTheme,
           'v|verbose+', => \$debugLevel,
           'mapType|type=s' => \$mapType,
           'landcol=s' => \$landColour,
           'seacol=s' => \$seaColour,
           'bordcol=s' => \$borderColour,
           'subjects|sub=s@' => sub { $subjectNames{$_} = 1},
           'politicals|pol=s@' => sub { $politicalNames{$_} = 1},
           'only=s@' => sub { $onlyNames{$_} = 1},
           'data=s@' => \@dataFiles,
           'man' => sub { pod2usage({-verbose => 3}) }
          );

-  David

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

David Eccles (gringer)
In reply to this post by alexgibson
From: "Szelp, A. Sz." <[hidden email]>
> The issue with OpenScad not throwing an error when you pass an "undefined"
> parameter is, I was told, by design, such you can inject variables into the
> namespace. However, a Warning in this case would be very welcome! -- I had
> some time wasted with finding the bug when only a parameter was misspelled.

Yes, a warning would be much better than code syntax internationalisation.
If an appropriate variable were not injected and it was needed, warnings
would be great. I've had a few cases where I've had to debug thin slices
of things because I had something like "stickRadus*2" instead of
"stickRadius*2", or changed a variable name (e.g. from "mxr" to "mwr") and
missed one of the places.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Feature request - Accept spelling 'centre' to call function 'center'

alexgibson
In reply to this post by tp3
I see your concern about having the language available in multiple languages
- I don't want to pollute my original request - which is simply to not have
problems as a result of typing 'colour' or 'centre' which are of course
correct - without taking anything away from our American cousins...

There is a programming ethos to keep things as tightly defined as possible -
and to reject the 'clutter' that adding alternatives brings - so until a lot
of French or Italians show up asking for translated OpenSCAD maybe I should
narrow the scope to my original problem which it seems is shared by other
non-US native English speakers, which would be fixed with just a few
alternative spellings.  Hard to see how that could confuse, especially as
what is considered 'global' English varies by country.  OpenSCAD has a
relatively limited vocabulary so we're only talking a few words here.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of tp3
Sent: 29 January 2014 14:37
To: [hidden email]
Subject: Re: [OpenSCAD] Feature request - Accept spelling 'centre' to call
function 'center'

alexgibson wrote
> About the only issue I can see with this is backwards compatibility -
> running new scripts on old versions of OpenSCAD.  However, firstly,
> when is this a necessary thing to do?

Right, the important case is of cause the other way around. In the specific
case center/color it's probably no issue because the current logic with
different namespaces for variables and functions might resolve to the
correct behavior (but I didn't really validate that). But in the general
case, just think of a user having a variable colour which then would
conflict with the new module called colour.
I think for colour and centre it might be ok, to just accept both. I would
not see that as the same case as doing actual translation.


alexgibson wrote
> Seems like a simple idea would be a translation table for functions
> into multiple languages - I would be delighted to immediately provide
> translations of all function names for British English, Italian,
> French, German and Norwegian if anyone would be willing to code it
> into a version of OpenSCAD - let's try it!

Please no. I've updated the code that was lying around for translation of
the GUI (and possibly the error messages). We do have almost complete GUI
translation files for German and Russian now. So if someone wants to have a
look at other languages, that would be very welcome. I hope this code and
the translations will make it into the next release (even though I'll
probably stay with the English version instead of German).

But I really don't like the idea to have the scad language itself in
different languages. I could image something in the editor which would do
this kind of translations in the GUI layer only (but that's likely not too
easy to do).



-----
-- Torsten
--
View this message in context:
http://forum.openscad.org/Feature-request-Accept-spelling-centre-to-call-fun
ction-center-tp6697p6707.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
12