[seam-issues] [JBoss JIRA] Created: (JBSEAM-4548) Internationalization doesn't translate in the right language

Wojciech Kupiec (JIRA) jira-events at lists.jboss.org
Fri Feb 19 06:18:09 EST 2010


Internationalization doesn't translate in the right language
------------------------------------------------------------

                 Key: JBSEAM-4548
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4548
             Project: Seam
          Issue Type: Bug
    Affects Versions: 2.1.2.GA
         Environment: Linux; jboss-4.2.2.GA; i386
            Reporter: Wojciech Kupiec


The problem is that Messages.instance().get('') returns translation in wrong language in some circumstances.


To observe the bug do the following:

1. Make a component like this one:
@Name("TranslationTest")
@Scope(ScopeType.APPLICATION)
@AutoCreate
public class TranslationTest {

	@Asynchronous
	@Transactional
	public void scheduler(@Expiration Date when, @IntervalDuration Long interval) {
		System.out.print("Translated text is: #0 ".replace("#0", Messages.instance().get("validator.email")));
	}	
	
}

2. make an instance of the component when org.jboss.seam.postInitialization occures and set up the timer:

	@Observer("org.jboss.seam.postInitialization")
	public void postInitialization(){
		TranslationTest tt= (TranslationTest) Component.getInstance(TranslationTest.class, true);
		tt.scheduler(new Date(), 10000L);
	}


Messages.instance().get("validator.email") will always return translation in english no matter what are your default locale settings. 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list