rejetto forum
May 25, 2012, 11:23:45 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [special:import] translation  (Read 2848 times)
0 Members and 1 Guest are viewing this topic.
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« on: March 20, 2011, 06:34:53 PM »

- {.!text.} was not working in [special:import]

it works now? does not appear.  Huh?
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #1 on: March 21, 2011, 09:44:05 AM »

- {.!text.} was not working in [special:import]

it works now? does not appear.  Huh?

work for me with build 276
Quote
[special:import]
{.add to log| hello {.!mars|FRENCH CAN CAN.}
Cheesy
Do not forget that special:import is executed only once and only when you change the template:
private template --> restore default -->private template

Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #2 on: March 21, 2011, 02:05:24 PM »

[+special:strings]

Italian = it

English = en

Automatic = auto



language=it



[+special:import]


{.dialog| {.if|{.{.!language.}=it.}|

mars language Italian .}.}


{.dialog| {.if|{.{.!language.}=en.}|

mars language English .}.}


---------------------------------------------------------------------------------------------


In this way does not work for me is a bug.
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #3 on: March 21, 2011, 03:43:26 PM »

It works as it is, no particular problem, it is necessary to make sure that all the sections begin with one [+...], and to empty the cache of hfs, it is necessary for that to restart hfs.

It is necessary to watch not to put spaces at the level of strings, because they are included in the transcription

[+special:strings]

Italian=it

English=en

Automatic=auto



language=it
« Last Edit: March 21, 2011, 03:50:02 PM by Mars » Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #4 on: March 21, 2011, 06:53:08 PM »

The command to the macro is this:

[+special:strings]

language=it


these guys have nothing to do:

Italian = it

English = en

Automatic = auto
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #5 on: March 22, 2011, 08:32:55 AM »

if i copy and paste the text you say in a file "test.tpl", then drag&drop this file over hfs, it asks for "installing", i say yes, then i get this dialog

---------------------------
HFS 2.3 beta (276)
---------------------------
mars language Italian
---------------------------
OK   
---------------------------



That's what i expect to get. Don't you get the same?
Logged
rejetto forum
« Reply #5 on: March 22, 2011, 08:32:55 AM »

Do you like this software? Consider even $2
 Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #6 on: March 22, 2011, 01:23:13 PM »

if i copy and paste the text you say in a file "test.tpl", then drag&drop this file over hfs, it asks for "installing", i say yes, then i get this dialog

---------------------------
HFS 2.3 beta (276)
---------------------------
mars language Italian
---------------------------
OK  
---------------------------

That's what i expect to get. Don't you get the same?

yes rejetto this is working but edit the template test.tpl by replacing language=it by language=en ,then drag&drop this file over hfs, it asks for "installing", i say yes, then i get this dialog

---------------------------
HFS 2.3 beta (276)
---------------------------
mars language Italian                     <<-- and not English, special:strings is not cleared on new tpl Undecided
---------------------------
OK  
---------------------------


second bug; mars is french , not italian or english Cheesy Grin Wink
« Last Edit: March 22, 2011, 01:24:53 PM by Mars » Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #7 on: March 22, 2011, 01:44:26 PM »

I enclose here below the TPL with the problem to be solved:

Allego sotto qui il TPL con il problema da risolvere:

* TPL Ita-Eng.tpl (3.08 KB - downloaded 71 times.)
Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #8 on: March 22, 2011, 02:03:58 PM »

second bug; mars is french , not italian or english Cheesy Grin Wink

The second bug can not be solved, mars should change nationality and become Italian (it worsens his life). Cheesy Grin Cool

Il secondo bug non si può risolvere, mars dovrebbe cambiare nazionalità e diventare Italiano (ma peggiora la sua vita). Cheesy Grin Cool
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #9 on: March 22, 2011, 02:44:33 PM »

@french

{.and|{.{.!language.}=auto.}{.{.!language.}=it.}|{.not|{.{.!language.}=en.}.}

cannot work

same as

 ( color=blue & color=red & not color= green)  Grin

simply put
{.dialog|{.{.!language.}=it.}|

Grazie ...

and same to english dialog
 Wink
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #10 on: March 23, 2011, 09:22:40 AM »

@mars
it can work, i think
you should read it as
auto OR it AND NOT en

because when you have 2 tests attached, it behaves as an OR, because the 0/1 is joined to another 0/1 and the result is 00/01/10/11 (where only 00 is considered false, because is a numeric zero).

@french
you should use debug > enable macros.log
is a very useful feature to understand what's goin' on.
and i just saw where your problem is
when {.!language.} is evaluated, the result is

    en (N.B.: Impostato in questo modo si dovrebbe visualizzare il SOLO messaggio in lingua Inglese ma non funziona.)


and it's right by HFS, the bug is yours Wink
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #11 on: March 23, 2011, 09:30:16 AM »

as an additional suggestion
instead of having many {.dialog.} go for

{.dialog|{.switch|{.!language.}|
  | it | Ciao, così è molto meglio, non credi?
  | Hello! this is the default choice, if "language" is different from all of the above cases
.}.}
Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #12 on: March 23, 2011, 03:06:37 PM »

@french
you should use debug > enable macros.log
is a very useful feature to understand what's goin' on.
and i just saw where your problem is
when {.!language.} is evaluated, the result is

    en (N.B.: Impostato in questo modo si dovrebbe visualizzare il SOLO messaggio in lingua Inglese ma non funziona.)

rejetto ho già fatto la prova "debug > enable macros.log", ma penso che non funziona.

rejetto I did the test "debug> enable macros.log," but I think it does not work.


Quote
and it's right by HFS, the bug is yours Wink
a me sembra un bug di hfs, vedi il tpl allegato sotto. Cool

it seems to me a bug in HFS, see the tpl attached below. Cool

* TPL Ita.tpl (0.55 KB - downloaded 49 times.)
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #13 on: March 23, 2011, 06:54:12 PM »

@rejetto, there is realy a bug, i found the solution Wink

classeslib.pas

Quote
procedure Ttpl.fromString(txt:string);
begin
freeAndNIL(strTable);  // add by mars 23/03/2011  necessary when loading modified tpl
src:='';
sections:=NIL;
fileExts:=NIL;
last.section:=#255'null'; // '' is a valid (and often used) section name. This is a better null value.
appendString(txt);
end; // fromString

Quote
function TcachedTpls.getTplFor(fn:string):Ttpl; //update mars 23/03/2011  removed tests about crc and size of file
var
  i: integer;
  o: TcachedTplObj;
  s: string;
begin
fn:=trim(lowercase(fn));
i:=indexOf(fn);
if i >= 0 then
  o:=objects[ i] as TcachedTplObj
else
  begin
  o:=TcachedTplObj.create();
  addObject(fn, o);
  end;
result:=o.tpl;
if getMtime(fn) <= o.ts then exit;
o.ts:=getMtime(fn);
o.size:=sizeOfFile(fn);
s:=loadFile(fn);
o.crc:=getCRC(s); // <=== warning line updated
if o.tpl = NIL then
  begin
  result:=Ttpl.create();
  o.tpl:=result;
  end;
o.tpl.fromString(s);
end; // getTplFor
« Last Edit: March 23, 2011, 08:36:37 PM by SilentPliz » Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #14 on: March 23, 2011, 08:02:53 PM »

Very nice Mars ! Cool

This code fix also an very old bug with [+special:strings] ... when we changed template on the fly in different language, it was often remained some slag from previous language.
It is no longer the case!

Thank you! Wink

 
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 22, 2012, 11:30:47 PM