package play.i18n;

import scala.collection.mutable.Buffer;

import java.util.Arrays;

/**
 * High-level internationalisation API.
 */
public class Messages {

    /**
    * Translates a message.
    *
    * Uses `java.text.MessageFormat` internally to format the message.
    *
    * @param lang the message lang
    * @param key the message key
    * @param args the message arguments
    * @return the formatted message or a default rendering if the key wasn't defined
    */
    public static String get(Lang lang, String key, Object... args) {
        Buffer scalaArgs = scala.collection.JavaConverters.asScalaBufferConverter(Arrays.asList(args)).asScala();
        return play.api.i18n.Messages.apply(key, scalaArgs, (play.api.i18n.Lang)lang);
    }
    
    /**
    * Translates a message.
    *
    * Uses `java.text.MessageFormat` internally to format the message.
    *
    * @param key the message key
    * @param args the message arguments
    * @return the formatted message or a default rendering if the key wasn't defined
    */
    public static String get(String key, Object... args) {
        Buffer scalaArgs = scala.collection.JavaConverters.asScalaBufferConverter(Arrays.asList(args)).asScala();
        return play.api.i18n.Messages.apply(key, scalaArgs, (play.api.i18n.Lang)play.mvc.Http.Context.Implicit.lang());
    }
    
}

@@ -548,32 +548,40 @@
 %7B%0A        Buffer
+%3CObject%3E
  scalaArgs = sca
@@ -724,36 +724,16 @@
 laArgs, 
-(play.api.i18n.Lang)
 lang);%0A 
@@ -1099,16 +1099,24 @@
   Buffer
+%3CObject%3E
  scalaAr
@@ -1271,28 +1271,8 @@
 gs, 
-(play.api.i18n.Lang)
 play

Remove cast