Author Topic: Autolisp / DCL in multiple languages.  (Read 562 times)

0 Members and 1 Guest are viewing this topic.

FELIX

  • Bull Frog
  • Posts: 215
Autolisp / DCL in multiple languages.
« on: July 21, 2021, 08:31:44 AM »
Any tips, guidance, tricks to make an Autolisp with DCL in several languages?
OK.

CodeDing

  • Mosquito
  • Posts: 16
Re: Autolisp / DCL in multiple languages.
« Reply #1 on: July 21, 2021, 10:44:41 AM »
Felix,

Since you can place multiple dialogs into one DCL file, I would recommend making a DCL file for each language you choose to incorporate, but just remember to keep your keys the same across all files.

Any task with multiple languages is quite the project no matter how you try to approach it. I wish you luck!

Best,
~DD

d2010

  • Newt
  • Posts: 185
Re: Autolisp / DCL in multiple languages.
« Reply #2 on: July 21, 2021, 11:30:31 AM »
== I work 23hours for this solution. I need more help,because is very hard
to speed-up my routinne jc_cws12.
 :embarrassed:
==For DCL, language , you must store all messages inside  program.Lisp
Please you, do not store messages inside DCL.
== You must have language.ini generator from Lisp, attached near path0user.
Code: [Select]
You see here language.ini generated Automated
This contain sysvar'names , but I can remove from List, bellow.
[pp_pointperppline.vlax]
001="a251err<>str"
002="You acad::eUserBreak\n"
003="\n"
004=".UNDO"
005="_END"
006="\nEnd"
007="TEMP"
008="TMP"
009="TEMPPREFIX"
010="TMP"
011="XLOADPATH"
012="TMP"
013="*[\\]*"
014="\\"
015="PROGRAM"
016="ICAD*"
017="acad*"
018="*zwc*"
019="pagefile.sys"
020="ACADVER"
021=" Warning Minim Req : AutoCAD 14.0 or highter"
022="_.undo"
023="Auto"
024="On"
025=".UNDO"
026="_BEGIN"
027="MODEMACRO"
028="UCSICON"
029="ISAVEBAK"
030="SAVETIME"
031="BLIPMODE"
==I need  help, because, I need more features of String?
Any tips, guidance, tricks to make an Autolisp with DCL in several languages?
==You compare same function with language.ini and without language.ini
Code: [Select]
(DeFun dfn_cad_asysset( / rr io kj su bya lz)
  (setq su "" bya "with language.ini++")
  (setq;|a000|;
const_ppfiletmp (str_pathtemp)
str_pathtempA const_ppfiletmp
const_ppfiletmp (strcat const_ppfiletmp (jc_cws12 144 14))) (setq;|a000|;
rr (atof (getvar (jc_cws12 158 9)))) (if (<  rr 14.0)
 (alert (jc_cws12 167 46))) (if (<  rr 15.0) (setq;|a000|;
*error* nil)) (setq;|a000|;
io (command (jc_cws12 213 8) (jc_cws12 221 6) (jc_cws12 227 4))) (setq;|a000|;
kj (dfn_cadver_isicad)) (if (=  kj 2) (setq;|a000|;
io (list (vl-load-com) (textscr)))) (setq;|a000|;
_ax rr) (command (jc_cws12 231 7) (jc_cws12 238 8)) (setq;|a000|;
lz (list (list (jc_cws12 246 11) bya) (list (jc_cws12 257 9) 1) (list (jc_cws12 266 10) 1) (list (jc_cws12 276 10) 15) (list (jc_cws12 286 10) 0))) (setq;|a000|;
_ppcx_init_vars (syst_setvars lz)) (setq;|a000|;
_pp_var1chkm nil
lz nil
dfn_var_chkC "")
rr)
==You seen without langauge.ini
==How to upgrade together this-solution.?
Code: [Select]
(DeFun dfn_cad_asysset( / rr io kj su bya lz)
  (setq su "" bya "without language.ini--")
  (setq;|a000|;
const_ppfiletmp (str_pathtemp)
str_pathtempA const_ppfiletmp
const_ppfiletmp (strcat const_ppfiletmp "pagefile.sys")) (setq;|a000|;
rr (atof (getvar "ACADVER"))) (if (<  rr 14.0)
(alert " Warning Minim Req : AutoCAD 14.0 or highter")) (if (<  rr 15.0) (setq;|a000|;
*error* nil)) (setq;|a000|;
io (command "_.undo" "Auto" "On")) (setq;|a000|;
kj (dfn_cadver_isicad)) (if (=  kj 2) (setq;|a000|;
io (list (vl-load-com) (textscr)))) (setq;|a000|;
_ax rr) (command ".UNDO" "_BEGIN") (setq;|a000|;
lz (list (list "MODEMACRO" bya) (list "UCSICON" 1) (list "ISAVEBAK" 1) (list "SAVETIME" 15) (list "BLIPMODE" 0))) (setq;|a000|;
_ppcx_init_vars (syst_setvars lz)) (setq;|a000|;
_pp_var1chkm nil
lz nil
dfn_var_chkC "")
rr)

== Is very hard, for develop more-pratically.(How run google'Translate?)
==If you are interested , then you replay here.


« Last Edit: July 21, 2021, 11:45:17 AM by d2010 »

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #3 on: July 21, 2021, 11:43:55 AM »
Felix,

Since you can place multiple dialogs into one DCL file, I would recommend making a DCL file for each language you choose to incorporate, but just remember to keep your keys the same across all files.

Any task with multiple languages is quite the project no matter how you try to approach it. I wish you luck!

Best,
~DD

It's a good suggestion.
OK.

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #4 on: July 21, 2021, 11:45:04 AM »
d2010 I didn't understand your suggestion.
OK.

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #5 on: July 21, 2021, 11:53:02 AM »
My system has 52 DCL files and over 300 dialogs.

I thought of making a function to use within the LSP a "set_tile" for each "key" of "label" according to the language that will initially be 5 languages.
This function would have as arguments: language, DCL file, dialog name and key.
The translations would be in a table for each language.

Anyone have more suggestions?
OK.

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #6 on: July 21, 2021, 11:55:43 AM »
Quote from: FELIX link=topic=56905.msg605657#msg605657
date=1626882304
d2010 I didn't understand your suggestion.
:whistling:
Code: [Select]
Romania-Language
Eu plec doua trei zile, dela locul de munca, si nu mai am acces pe internet, deoarecejobul necesita lucrari de teren.
Noi avem nevoie de devzoltare practica, pe programe.Lisp, care sunt
cerute la locul de munca.
Daca tu vrei sa dezvolti language.ini, pentru proiectele tale.?

I still do not understand! is on the right topic?
OK.

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #7 on: July 21, 2021, 12:25:53 PM »
d2010, You are completely wrong to refer that I posted SPAM.
I didn't post the name or link to my system.
I posted its size to show that I am interested in several suggestions to see what is the best way to do it as it will be an extensive work.
OK.

CodeDing

  • Mosquito
  • Posts: 16
Re: Autolisp / DCL in multiple languages.
« Reply #8 on: July 21, 2021, 12:34:43 PM »
Felix,

From what I have seen at other posts, the responses by d2010 do not normally relate to the topic at hand. Also they are often confusing or vague. I would take their replies with caution.

Best,
~DD

VovKa

  • Swamp Rat
  • Posts: 1352
  • Ukraine
Re: Autolisp / DCL in multiple languages.
« Reply #9 on: July 21, 2021, 12:37:14 PM »
Anyone have more suggestions?
i do not store dcls inside my project, all dialogs are generated, written and loaded on-the-fly from the template
smth like the following
Quote
(strcat   "IRT_Main:dialog{label=\"%1%\";"
   ":column{"
   (strcat   ":boxed_row{"                   ":button{key=\"Update\";label=\"%26%\";width=20;}"
      ":button{key=\"Request\";label=\"%27%\";width=20;}"    ":button{key=\"Donate\";label=\"%28%\";width=20;}"
      "}"
          )
   "}"
   (strcat
     ":row{"
     "spacer_1;"
     ":button{key=\"Accept\";label=\"%18%\";width=20;fixed_width=true;is_default=true;}"
     ":button{key=\"Cancel\";label=\"%19%\";width=20;fixed_width=true;is_cancel=true;}"
     "spacer_1;}"
    )
   ":text{key=\"InfoText\";alignment=centered;}"
   ":toggle{label=\"%23%\";key=\"SaveAsDefault\";}"
   "}"
)

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9675
Re: Autolisp / DCL in multiple languages.
« Reply #10 on: July 21, 2021, 01:15:14 PM »
== I work 23hours for this solution. I need more help,because is very hard
to speed-up my routinne jc_cws12.
 :embarrassed:
==For DCL, language , you must store all messages inside  program.Lisp
Please you, do not store messages inside DCL.
== You must have language.ini generator from Lisp, attached near path0user.
...

Very interesting! You developed a "string translator" for lisp? It looks like it produces a "lookup table" which you reference; that must make programming very difficult.
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #11 on: July 21, 2021, 01:36:23 PM »
d2010: I already communicated the moderator to see if I posted spam or not.

CodeDing: grateful for the intermediation.

CodeDing: grateful for the suggestion.

VovKa: grateful for the suggestion, I didn't remember when I translated the IRT to Portuguese for you.

John Kaul: We can close this post. I'm already satisfied.

OK?
OK.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9675
Re: Autolisp / DCL in multiple languages.
« Reply #12 on: July 21, 2021, 01:51:58 PM »
d2010: I already communicated the moderator to see if I posted spam or not.

CodeDing: grateful for the intermediation.

CodeDing: grateful for the suggestion.

VovKa: grateful for the suggestion, I didn't remember when I translated the IRT to Portuguese for you.

John Kaul: We can close this post. I'm already satisfied.

OK?

> CLOSE
No we cannot "close this thread"; Please understand that these topics are not only used by you but other people with the same problem. If you have a solution (and it was not posted), post the solution for other people to use or learn from -i.e. wouldn't it be better if someone with a similar problem posts a really neat solution in the future?  ...This forum exists for many people; I'm sorry but, I do not pay all this money and spend time maintaining this site just for individuals.

> SPAM
I don't think you spammed, (and you obviously do not feel as though you did) so it is not really a concern for the moderators or me. I will close the "report ticket".
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

FELIX

  • Bull Frog
  • Posts: 215
Re: Autolisp / DCL in multiple languages.
« Reply #13 on: July 21, 2021, 02:17:29 PM »
John Kaul (Se7en): I posted it closing to not generate further discussions but I agree that what is posted here positively is going to be useful for others.
Once again grateful for moderating.
OK.

BIGAL

  • Swamp Rat
  • Posts: 779
  • 30 + years of using Autocad
Re: Autolisp / DCL in multiple languages.
« Reply #14 on: July 21, 2021, 09:23:31 PM »
Just a maybe you could have 1 DCL it has variables for all the string stuff like para1 "Please choose" for english. You have a cond that says which language, so sets up all the parax values from a list using the Set function.

(setq englst (list "Please choose" "Enter length" "Enter width"))
(setq frenchlst .............
(setq spanishlst ...........

Code: [Select]
do a foreach etc this is example
use a cond for which language
(setq lst englst)

(setq x 0)
(foreach str lst
(set (read (strcat "para" (rtos (setq x (1+ x)) 2 0))) str)
)

(strcat "label = " para1 etc
A man who never made a mistake never made anything

d2010

  • Newt
  • Posts: 185
Re: Autolisp / DCL in multiple languages.
« Reply #15 on: Today at 02:55:51 AM »
This solution is not cheap, but You import experienced in languageTranslator
(from Lazarus,FreePascal.), The other/s Developer/s(C#, C++,Java,Delphi10) earning experienced many years in LanguageAutoTranslator.
 :smitten:
a)You can try compile the Language.ini to *.DLL using Delphi.NET
b)You import Unit languageTranslator.pas into yourThisDotNet.DLL
--This  yourThisDotNet.DLL must autotranslate the string To Any language
c)You can ask help from other programming-language
https://components4developers.blog/2021/07/17/i18n-with-kbmmw-2/?fbclid=IwAR0Je7PkDbr2Ra93jW-21aPIrKaoZnjWUzChz3jd8z-95f7JC-Pv1sX4Teo
d)You load yourThisDotNet.DLL inside AutoCAd.
{--}
Anyone, you must hire other programmer. is Not FreePay.(exception FreePascal,LAzarus).
 :whistling:

Felix,
From what I have seen at other posts, the responses by d2010 do not normally relate to the topic at hand. Also they are often confusing or vague. I would take their replies with caution.

« Last Edit: Today at 03:05:26 AM by d2010 »