[Rife-users] Localization in radio button labels

2006-01-11 Thread Lars Grupe
Hi,

A L10N value inside of an FORM:LABEL block will not be replaced.
Is there something wrong in my code or is there a reason why it does not
work?

Example:

!--V 'FORM:RADIO:ruleGeneration'/--
!--B 'FORM:LABEL:ruleGeneration:termbased'--!--V
'L10N:TERM_BASED'/--!--/B--
!--B 'FORM:LABEL:ruleGeneration:lemmabased'--!--V
'L10N:LEMMA_BASED'/--!--/B--

Cheers,
Lars
___
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users


Re: [Rife-users] Localization in radio button labels

2006-01-11 Thread Geert Bevin

Hi Lars,

how is this form being generated? Do you call it explicitly from your  
element or do you let RIFE automate it? What the model bean that  
corresponds to this?


Best regards,

Geert

On 11-jan-06, at 15:43, Lars Grupe wrote:


Hi,

A L10N value inside of an FORM:LABEL block will not be replaced.
Is there something wrong in my code or is there a reason why it  
does not

work?

Example:

!--V 'FORM:RADIO:ruleGeneration'/--
!--B 'FORM:LABEL:ruleGeneration:termbased'--!--V
'L10N:TERM_BASED'/--!--/B--
!--B 'FORM:LABEL:ruleGeneration:lemmabased'--!--V
'L10N:LEMMA_BASED'/--!--/B--

Cheers,
Lars
___
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users



--
Geert Bevin   Uwyn bvba
Use what you need   Avenue de Scailmont 34
http://www.uwyn.com   7170 Manage, Belgium
gbevin[remove] at uwyn dot comTel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


___
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users


Re: [Rife-users] Localization in radio button labels

2006-01-11 Thread Geert Bevin

When do you add the resourcebundles to your template?

Lars Grupe wrote:

Hi Geert,

the main parts of the Bean are the following: 


private String fileName = null;
private String termbankId = null;
private String ruleGeneration = null;

public ImportDataBean(String fileName, String termbankId,
String ruleGeneration)
{
this.fileName = fileName;
this.termbankId = termbankId;
this.ruleGeneration = ruleGeneration;
}

public ImportDataBean()
{
}

protected void activateValidation()
{
addConstraint(new
ConstrainedProperty(ruleGeneration).inList(new String[]{
termbased, lemmabased}));
}

And the form is generated inside the elements java code with the
following call:

generateForm(template, new ImportDataBean());

If I write text in the form label block it is shown correctly.
e.g.: 
!--B 'FORM:LABEL:ruleGeneration:termbased'--That's fine!!--/B--


And if I use the same Localization block (e.g.: !--V
'L10N:TERM_BASED'/--) outside the FORM:LABEL block it is also displayed
correctly. 


Cheers,
Lars




-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin

Sent: 11 January 2006 15:54
To: RIFE users list : questions, bug reports and suggestions.
Subject: Re: [Rife-users] Localization in radio button labels


Hi Lars,

how is this form being generated? Do you call it explicitly 
from your  
element or do you let RIFE automate it? What the model bean that  
corresponds to this?


Best regards,

Geert

On 11-jan-06, at 15:43, Lars Grupe wrote:



Hi,

A L10N value inside of an FORM:LABEL block will not be replaced. Is 
there something wrong in my code or is there a reason why it

does not
work?

Example:

!--V 'FORM:RADIO:ruleGeneration'/--
!--B 'FORM:LABEL:ruleGeneration:termbased'--!--V
'L10N:TERM_BASED'/--!--/B--
!--B 'FORM:LABEL:ruleGeneration:lemmabased'--!--V
'L10N:LEMMA_BASED'/--!--/B--

Cheers,
Lars
___
Rife-users mailing list
Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users



--
Geert Bevin   Uwyn bvba
Use what you need   Avenue de Scailmont 34
http://www.uwyn.com   7170 Manage, Belgium
gbevin[remove] at uwyn dot comTel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 
309F D6A9 Public PGP key  : available at servers pgp.mit.edu, 
wwwkeys.pgp.net



___
Rife-users mailing list
Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users



___
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users



--
Geert Bevin   Uwyn bvba
Use what you need   Avenue de Scailmont 34
http://www.uwyn.com   7170 Manage, Belgium
gbevin[remove] at uwyn dot comTel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
___
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users


RE: [Rife-users] Localization in radio button labels

2006-01-11 Thread Lars Grupe
Hi Geert,

There could be the problem.
I do it like the following:

public void processElement()
{
Template template = Generic.getTemplate(this, templateName);
ResourceBundle resourceBundle = Generic.getResourceBundle(this);

printTemplate(template, resourceBundle);
}

private void printTemplate(Template template,
ResourceBundle resourceBundle)
{
ImportWizard.addStepBar(template, resourceBundle, options);

ImportDataBean importData = getInputSerializable(importData);
if (importData == null)
{
importData = new ImportDataBean();
}

generateForm(template, new ImportDataBean());

Generic.addSubmitButton(template, resourceBundle,
ConstantString.BACK, previousStepButton);
Generic.addSubmitButton(template, resourceBundle,
ConstantString.CONTINUE, nextStepButton);

print(template);
}

public static Template getTemplate(Element element, String
templateName)
{
// In fact of the language selection the resourceBundle must be
// taken after the template
Template template = element.getHtmlTemplate(templateName);
ResourceBundle resourceBundle =
Generic.getResourceBundle(element);
template.addResourceBundle(resourceBundle);
return template;
}

Maybe adding the ResourceBundle after calling getHtmlTemplate causes
these problem.
But this is the only problem I have with this order.

Cheers,
Lars

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
 Sent: 11 January 2006 16:09
 To: RIFE users list : questions, bug reports and suggestions.
 Subject: Re: [Rife-users] Localization in radio button labels
 
 
 When do you add the resourcebundles to your template?
 
 Lars Grupe wrote:
  Hi Geert,
  
  the main parts of the Bean are the following:
  
  private String fileName = null;
  private String termbankId = null;
  private String ruleGeneration = null;
  
  public ImportDataBean(String fileName, String termbankId,
  String ruleGeneration)
  {
  this.fileName = fileName;
  this.termbankId = termbankId;
  this.ruleGeneration = ruleGeneration;
  }
  
  public ImportDataBean()
  {
  }
  
  protected void activateValidation()
  {
  addConstraint(new 
  ConstrainedProperty(ruleGeneration).inList(new String[]{
  termbased, lemmabased}));
  }
  
  And the form is generated inside the elements java code with the 
  following call:
  
  generateForm(template, new ImportDataBean());
  
  If I write text in the form label block it is shown correctly.
  e.g.:
  !--B 'FORM:LABEL:ruleGeneration:termbased'--That's fine!!--/B--
  
  And if I use the same Localization block (e.g.: !--V
  'L10N:TERM_BASED'/--) outside the FORM:LABEL block it is also 
  displayed correctly.
  
  Cheers,
  Lars
  
  
  
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
 Sent: 11 January 2006 15:54
 To: RIFE users list : questions, bug reports and suggestions.
 Subject: Re: [Rife-users] Localization in radio button labels
 
 
 Hi Lars,
 
 how is this form being generated? Do you call it explicitly
 from your  
 element or do you let RIFE automate it? What the model bean that  
 corresponds to this?
 
 Best regards,
 
 Geert
 
 On 11-jan-06, at 15:43, Lars Grupe wrote:
 
 
 Hi,
 
 A L10N value inside of an FORM:LABEL block will not be replaced. Is
 there something wrong in my code or is there a reason why it
 does not
 work?
 
 Example:
 
 !--V 'FORM:RADIO:ruleGeneration'/--
 !--B 'FORM:LABEL:ruleGeneration:termbased'--!--V
 'L10N:TERM_BASED'/--!--/B--
 !--B 'FORM:LABEL:ruleGeneration:lemmabased'--!--V
 'L10N:LEMMA_BASED'/--!--/B--
 
 Cheers,
 Lars
 ___
 Rife-users mailing list
 Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
 
 
 --
 Geert Bevin   Uwyn bvba
 Use what you need   Avenue de Scailmont 34
 http://www.uwyn.com   7170 Manage, Belgium
 gbevin[remove] at uwyn dot comTel +32 64 84 80 03
 
 PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D
 309F D6A9 Public PGP key  : available at servers pgp.mit.edu, 
 wwwkeys.pgp.net
 
 
 ___
 Rife-users mailing list
 Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
 
  
  ___
  Rife-users mailing list
  Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
  
 
 -- 
 Geert Bevin   Uwyn bvba
 Use what you need   Avenue de Scailmont 34
 http://www.uwyn.com   7170 Manage, Belgium
 gbevin[remove] at uwyn dot comTel +32 64 84 80 03
 
 PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 
 309F

Re: [Rife-users] Localization in radio button labels

2006-01-11 Thread Geert Bevin

Hi Lars,

can you try doing this after adding your resourcebundle:
template.evaluateL10nTags();

The reason for this is that the template localization tags are only 
evaluated at certain times. When you have default resourcebundles, the 
template factory knows that they exist and it will call add them when 
the template is instantiated and during the initialization the 
evaluateL10nTags method will be called. Similarly, in the getContent() 
and getDeferredContent() methods, the template knows that you're done 
and that all the l10n information can be finalized.


When you build a form however, the contents of the block tags are 
extracted from the template to build the form. If your l10n tags aren't 
evaluated by then, the content will be empty and the form will be built 
with that.


I hope this works and makes sense.

Best regards,

Geert

Lars Grupe wrote:

Hi Geert,

There could be the problem.
I do it like the following:

public void processElement()
{
Template template = Generic.getTemplate(this, templateName);
ResourceBundle resourceBundle = Generic.getResourceBundle(this);

printTemplate(template, resourceBundle);
}

private void printTemplate(Template template,
ResourceBundle resourceBundle)
{
ImportWizard.addStepBar(template, resourceBundle, options);

ImportDataBean importData = getInputSerializable(importData);
if (importData == null)
{
importData = new ImportDataBean();
}

generateForm(template, new ImportDataBean());

Generic.addSubmitButton(template, resourceBundle,
ConstantString.BACK, previousStepButton);
Generic.addSubmitButton(template, resourceBundle,
ConstantString.CONTINUE, nextStepButton);

print(template);
}

public static Template getTemplate(Element element, String
templateName)
{
// In fact of the language selection the resourceBundle must be
// taken after the template
Template template = element.getHtmlTemplate(templateName);
ResourceBundle resourceBundle =
Generic.getResourceBundle(element);
template.addResourceBundle(resourceBundle);
return template;
}

Maybe adding the ResourceBundle after calling getHtmlTemplate causes
these problem.
But this is the only problem I have with this order.

Cheers,
Lars



-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin

Sent: 11 January 2006 16:09
To: RIFE users list : questions, bug reports and suggestions.
Subject: Re: [Rife-users] Localization in radio button labels


When do you add the resourcebundles to your template?

Lars Grupe wrote:


Hi Geert,

the main parts of the Bean are the following:

   private String fileName = null;
   private String termbankId = null;
   private String ruleGeneration = null;

   public ImportDataBean(String fileName, String termbankId,
   String ruleGeneration)
   {
   this.fileName = fileName;
   this.termbankId = termbankId;
   this.ruleGeneration = ruleGeneration;
   }

   public ImportDataBean()
   {
   }

   protected void activateValidation()
   {
   addConstraint(new 
ConstrainedProperty(ruleGeneration).inList(new String[]{

   termbased, lemmabased}));
   }

And the form is generated inside the elements java code with the 
following call:


generateForm(template, new ImportDataBean());

If I write text in the form label block it is shown correctly.
e.g.:
!--B 'FORM:LABEL:ruleGeneration:termbased'--That's fine!!--/B--

And if I use the same Localization block (e.g.: !--V
'L10N:TERM_BASED'/--) outside the FORM:LABEL block it is also 
displayed correctly.


Cheers,
Lars





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
Sent: 11 January 2006 15:54
To: RIFE users list : questions, bug reports and suggestions.
Subject: Re: [Rife-users] Localization in radio button labels


Hi Lars,

how is this form being generated? Do you call it explicitly


from your  


element or do you let RIFE automate it? What the model bean that  
corresponds to this?


Best regards,

Geert

On 11-jan-06, at 15:43, Lars Grupe wrote:




Hi,

A L10N value inside of an FORM:LABEL block will not be replaced. Is
there something wrong in my code or is there a reason why it
does not
work?

Example:

!--V 'FORM:RADIO:ruleGeneration'/--
!--B 'FORM:LABEL:ruleGeneration:termbased'--!--V
'L10N:TERM_BASED'/--!--/B--
!--B 'FORM:LABEL:ruleGeneration:lemmabased'--!--V
'L10N:LEMMA_BASED'/--!--/B--

Cheers,
Lars
___
Rife-users mailing list
Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users



--
Geert Bevin   Uwyn bvba
Use what you need   Avenue de Scailmont 34
http://www.uwyn.com   7170 Manage, Belgium
gbevin[remove] at uwyn dot comTel +32 64 84 80 03

PGP

RE: [Rife-users] Localization in radio button labels

2006-01-11 Thread Lars Grupe
Hi Geert,

thx, that's working now.

Cheers,
Lars

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
 Sent: 11 January 2006 16:41
 To: RIFE users list : questions, bug reports and suggestions.
 Subject: Re: [Rife-users] Localization in radio button labels
 
 
 Hi Lars,
 
 can you try doing this after adding your resourcebundle: 
 template.evaluateL10nTags();
 
 The reason for this is that the template localization tags are only 
 evaluated at certain times. When you have default 
 resourcebundles, the 
 template factory knows that they exist and it will call add them when 
 the template is instantiated and during the initialization the 
 evaluateL10nTags method will be called. Similarly, in the 
 getContent() 
 and getDeferredContent() methods, the template knows that you're done 
 and that all the l10n information can be finalized.
 
 When you build a form however, the contents of the block tags are 
 extracted from the template to build the form. If your l10n 
 tags aren't 
 evaluated by then, the content will be empty and the form 
 will be built 
 with that.
 
 I hope this works and makes sense.
 
 Best regards,
 
 Geert
 
 Lars Grupe wrote:
  Hi Geert,
  
  There could be the problem.
  I do it like the following:
  
  public void processElement()
  {
  Template template = Generic.getTemplate(this, templateName);
  ResourceBundle resourceBundle = 
  Generic.getResourceBundle(this);
  
  printTemplate(template, resourceBundle);
  }
  
  private void printTemplate(Template template,
  ResourceBundle resourceBundle)
  {
  ImportWizard.addStepBar(template, resourceBundle, 
 options);
  
  ImportDataBean importData = 
 getInputSerializable(importData);
  if (importData == null)
  {
  importData = new ImportDataBean();
  }
  
  generateForm(template, new ImportDataBean());
  
  Generic.addSubmitButton(template, resourceBundle,
  ConstantString.BACK, previousStepButton);
  Generic.addSubmitButton(template, resourceBundle,
  ConstantString.CONTINUE, nextStepButton);
  
  print(template);
  }
  
  public static Template getTemplate(Element element, String
  templateName)
  {
  // In fact of the language selection the 
 resourceBundle must be
  // taken after the template
  Template template = element.getHtmlTemplate(templateName);
  ResourceBundle resourceBundle = 
  Generic.getResourceBundle(element);
  template.addResourceBundle(resourceBundle);
  return template;
  }
  
  Maybe adding the ResourceBundle after calling 
 getHtmlTemplate causes 
  these problem. But this is the only problem I have with this order.
  
  Cheers,
  Lars
  
  
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
 Sent: 11 January 2006 16:09
 To: RIFE users list : questions, bug reports and suggestions.
 Subject: Re: [Rife-users] Localization in radio button labels
 
 
 When do you add the resourcebundles to your template?
 
 Lars Grupe wrote:
 
 Hi Geert,
 
 the main parts of the Bean are the following:
 
 private String fileName = null;
 private String termbankId = null;
 private String ruleGeneration = null;
 
 public ImportDataBean(String fileName, String termbankId,
 String ruleGeneration)
 {
 this.fileName = fileName;
 this.termbankId = termbankId;
 this.ruleGeneration = ruleGeneration;
 }
 
 public ImportDataBean()
 {
 }
 
 protected void activateValidation()
 {
 addConstraint(new
 ConstrainedProperty(ruleGeneration).inList(new String[]{
 termbased, lemmabased}));
 }
 
 And the form is generated inside the elements java code with the
 following call:
 
 generateForm(template, new ImportDataBean());
 
 If I write text in the form label block it is shown correctly.
 e.g.:
 !--B 'FORM:LABEL:ruleGeneration:termbased'--That's fine!!--/B--
 
 And if I use the same Localization block (e.g.: !--V
 'L10N:TERM_BASED'/--) outside the FORM:LABEL block it is also
 displayed correctly.
 
 Cheers,
 Lars
 
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
 Sent: 11 January 2006 15:54
 To: RIFE users list : questions, bug reports and suggestions.
 Subject: Re: [Rife-users] Localization in radio button labels
 
 
 Hi Lars,
 
 how is this form being generated? Do you call it explicitly
 
 from your
 
 element or do you let RIFE automate it? What the model bean that
 corresponds to this?
 
 Best regards,
 
 Geert
 
 On 11-jan-06, at 15:43, Lars Grupe wrote:
 
 
 
 Hi,
 
 A L10N value inside of an FORM:LABEL block will not be 
 replaced. Is 
 there something wrong in my code or is there a reason 
 why it does 
 not work?
 
 Example:
 
 !--V