java.lang.Object
colesico.framework.pebble.internal.T9nFunction
All Implemented Interfaces:
com.mitchellbosecke.pebble.extension.Function, com.mitchellbosecke.pebble.extension.NamedArguments

public class T9nFunction
extends java.lang.Object
implements com.mitchellbosecke.pebble.extension.Function
This function perform string translation by previously loaded dictionary (with t9nDictionary tag)

Filter usage example: {{ t9n("strKey") }} - for dictionary name 'messages' {{ t9n("strKey", myName) }} - for dictionary name 'myName' {{ t9n("strKey", [param1, param2]) }} - for dictionary name 'messages' {{ t9n("myStringKey" , myName,[param1, param2]) }} - for dictionary name 'myName'

Author:
Vladlen Larionov
See Also:
T9nDictionaryParser
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String FUNCTION_NAME  
  • Constructor Summary

    Constructors 
    Constructor Description
    T9nFunction()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object execute​(java.util.Map<java.lang.String,​java.lang.Object> args, com.mitchellbosecke.pebble.template.PebbleTemplate pebbleTemplate, com.mitchellbosecke.pebble.template.EvaluationContext context, int lineNumber)  
    java.util.List<java.lang.String> getArgumentNames()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • execute

      public java.lang.Object execute​(java.util.Map<java.lang.String,​java.lang.Object> args, com.mitchellbosecke.pebble.template.PebbleTemplate pebbleTemplate, com.mitchellbosecke.pebble.template.EvaluationContext context, int lineNumber)
      Specified by:
      execute in interface com.mitchellbosecke.pebble.extension.Function
    • getArgumentNames

      public java.util.List<java.lang.String> getArgumentNames()
      Specified by:
      getArgumentNames in interface com.mitchellbosecke.pebble.extension.NamedArguments