Package org.bladerunnerjs.plugin

Examples of org.bladerunnerjs.plugin.Locale$Messages


    for (Asset asset : propertyAssets)
    {
      if (asset instanceof I18nFileAsset)
      {
        I18nFileAsset i18nAsset = (I18nFileAsset) asset;
        Locale assetLocale = i18nAsset.getLocale();
        if (assetLocale.isCompleteLocale())
        {
          languageAndLocationAssets.add(i18nAsset);
        }
        else if (!assetLocale.isEmptyLocale())
        {
          languageOnlyAssets.add(i18nAsset);
        }
      }
    }
View Full Code Here


  }
 
  private void filterAndAssert(String input, String expectedOutput, BundleSet bundleSet, RequestMode opMode, String locale) throws Exception
  {
    StringWriter writer = new StringWriter();
    TagPluginUtility.filterContent(input, bundleSet, writer, opMode, new Locale(locale), brjs.getAppVersionGenerator().getDevVersion());
    assertEquals(expectedOutput, writer.toString());
  }
View Full Code Here

    assertEquals(expectedOutput, writer.toString());
  }
 
  private void filterAndAssertMapReturned(String input, Map<String,Map<String,String>> expectedResult, BundleSet bundleSet, RequestMode opMode, String locale) throws Exception
  {
     Map<String,Map<String,String>> actualResult = TagPluginUtility.getUsedTagsAndAttributes(input, bundleSet, opMode, new Locale(locale), brjs.getAppVersionGenerator().getDevVersion());
    assertEquals(expectedResult, actualResult);
  }
View Full Code Here

  }
 
  private boolean localeMatches(String contentPath, Locale locale) throws MalformedRequestException {
    String contentPathLanguageCode = cssContentPlugin.getContentPathParser().parse(contentPath).properties.get("languageCode");
    String contentPathCountryCode = cssContentPlugin.getContentPathParser().parse(contentPath).properties.get("countryCode");
    Locale contentPathLocale = new Locale(contentPathLanguageCode, contentPathCountryCode);
    return ( contentPathLocale.isEmptyLocale() || locale.isAbsoluteOrPartialMatch(contentPathLocale) );
  }
View Full Code Here

 
  private void verifyLocales(String locales) throws ConfigException {
    try {
        String[] localeStrings = locales.split("\\s*,\\s*");
        for (int i = 0; i < localeStrings.length; i++) {
          Locale locale = new Locale(localeStrings[i]);
          if (locale.isEmptyLocale()) {
            throw new ConfigException("Locales cannot be empty and must be in the format " + Locale.LANGUAGE_AND_COUNTRY_CODE_FORMAT);
          }
        }
    } catch (IllegalArgumentException ex) {
      throw new ConfigException("Error in the config file " + getUnderlyingFile().getPath(), ex);
View Full Code Here

  public AppConfCommander setLocales(final String locales) throws Exception {
    call(new Command() {
      public void call() throws Exception {
        List<Locale> createdLocales = new ArrayList<Locale>();
        for (String locale : locales.split(",")) {
          createdLocales.add( new Locale(locale) );
        }
        appConf.setLocales( createdLocales.toArray(new Locale[0]) );
        appConf.write();
      }
    });
View Full Code Here

  }

  public void pageLoaded(StringBuffer pageResponse, String locale) throws ConfigException, IOException, ModelOperationException, NoTagHandlerFoundException, RequirePathException
  {
    StringWriter writer = new StringWriter()
    TagPluginUtility.filterContent(fileUtil.readFileToString(workbench.file("index.html")), workbench.getBundleSet(), writer, RequestMode.Dev, new Locale(locale), workbench.root().getAppVersionGenerator().getDevVersion());
    pageResponse.append(writer.toString());
  }
View Full Code Here

  public BuilderChainer hasSupportedLocales(String locales) throws ConfigException
  {
    List<Locale> createdLocales = new ArrayList<Locale>();
    for (String locale : locales.split(",")) {
      createdLocales.add( new Locale(locale) );
    }
    app.appConf().setLocales( createdLocales.toArray(new Locale[0]) );
    app.appConf().write();
   
    return builderChainer;
View Full Code Here

  }
 
  public CommanderChainer indexPageLoadedInDev(final StringBuffer pageResponse, final String locale) throws ConfigException, IOException, ModelOperationException, NoTagHandlerFoundException {
    call(new Command() {
      public void call() throws Exception {
        pageLoaded(pageResponse, new Locale(locale), RequestMode.Dev);
      }
    });
   
    return commanderChainer;
  }
View Full Code Here

  }

  public CommanderChainer indexPageLoadedInProd(final StringBuffer pageResponse, final String locale) throws ConfigException, IOException, ModelOperationException, NoTagHandlerFoundException {
    call(new Command() {
      public void call() throws Exception {
        pageLoaded(pageResponse, new Locale(locale), RequestMode.Prod);
      }
    });
   
    return commanderChainer;
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.plugin.Locale$Messages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.