Search in sources :

Example 1 with I18nDirectivesModule

use of com.google.template.soy.i18ndirectives.I18nDirectivesModule in project closure-templates by google.

the class SharedModule method configure.

@Override
protected void configure() {
    // Install the core directives.
    install(new CoreDirectivesModule());
    // Install default directive and function modules.
    install(new BasicDirectivesModule());
    install(new BidiDirectivesModule());
    install(new BasicFunctionsModule());
    install(new BidiFunctionsModule());
    install(new I18nDirectivesModule());
    // Create the API call scope.
    GuiceSimpleScope apiCallScope = new GuiceSimpleScope();
    bindScope(ApiCallScope.class, apiCallScope);
    // Make the API call scope instance injectable.
    bind(GuiceSimpleScope.class).annotatedWith(ApiCall.class).toInstance(apiCallScope);
    // Bind unscoped providers for parameters in ApiCallScope (these throw exceptions).
    bind(String.class).annotatedWith(LocaleString.class).toProvider(GuiceSimpleScope.<String>getUnscopedProvider()).in(ApiCallScope.class);
    bind(BidiGlobalDir.class).toProvider(GuiceSimpleScope.<BidiGlobalDir>getUnscopedProvider()).in(ApiCallScope.class);
}
Also used : I18nDirectivesModule(com.google.template.soy.i18ndirectives.I18nDirectivesModule) CoreDirectivesModule(com.google.template.soy.coredirectives.CoreDirectivesModule) BidiFunctionsModule(com.google.template.soy.bidifunctions.BidiFunctionsModule) ApiCall(com.google.template.soy.shared.restricted.ApiCallScopeBindingAnnotations.ApiCall) BidiDirectivesModule(com.google.template.soy.bididirectives.BidiDirectivesModule) BasicFunctionsModule(com.google.template.soy.basicfunctions.BasicFunctionsModule) BidiGlobalDir(com.google.template.soy.internal.i18n.BidiGlobalDir) BasicDirectivesModule(com.google.template.soy.basicdirectives.BasicDirectivesModule) LocaleString(com.google.template.soy.shared.restricted.ApiCallScopeBindingAnnotations.LocaleString)

Aggregations

BasicDirectivesModule (com.google.template.soy.basicdirectives.BasicDirectivesModule)1 BasicFunctionsModule (com.google.template.soy.basicfunctions.BasicFunctionsModule)1 BidiDirectivesModule (com.google.template.soy.bididirectives.BidiDirectivesModule)1 BidiFunctionsModule (com.google.template.soy.bidifunctions.BidiFunctionsModule)1 CoreDirectivesModule (com.google.template.soy.coredirectives.CoreDirectivesModule)1 I18nDirectivesModule (com.google.template.soy.i18ndirectives.I18nDirectivesModule)1 BidiGlobalDir (com.google.template.soy.internal.i18n.BidiGlobalDir)1 ApiCall (com.google.template.soy.shared.restricted.ApiCallScopeBindingAnnotations.ApiCall)1 LocaleString (com.google.template.soy.shared.restricted.ApiCallScopeBindingAnnotations.LocaleString)1