Tabnine Logo
AbstractLabels$LocaleSuffix
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractLabels$LocaleSuffix
in
jsettlers.graphics.localization

Best Java code snippets using jsettlers.graphics.localization.AbstractLabels$LocaleSuffix (Showing top 5 results out of 315)

origin: jsettlers/settlers-remake

@Override
protected InputStream getLocaleStream(LocaleSuffix locale) throws IOException {
  String filename = locale.getFileName("labels", ".properties");
  InputStream inputStream = getClass().getResourceAsStream(filename);
  return inputStream;
}
origin: jsettlers/settlers-remake

private void loadLabels() {
  LocaleSuffix[] locales = getLocaleSuffixes();
  for (LocaleSuffix locale : locales) {
    try {
      Properties currentLocaleLabels = new Properties(loadedLabels);
      InputStream inputStream = getLocaleStream(locale);
      if (inputStream == null) {
        throw new IOException();
      }
      currentLocaleLabels.load(new InputStreamReader(inputStream, "UTF-8"));
      loadedLabels = currentLocaleLabels;
      // Store the most dominant locale found.
      usedLocale = locale.getLocale();
    } catch (IOException e) {
      System.err.println("Warning: Could not load " + locale + ". Falling back to next file.");
    }
  }
}
origin: jsettlers/settlers-remake

/**
 * Gets a list of locale suffixes.
 * 
 * @return The list, ordered from least to most preferred.
 */
public LocaleSuffix[] getLocaleSuffixes() {
  LocaleSuffix[] locales = new LocaleSuffix[] {
      new LocaleSuffix(new Locale("en"), false),
      new LocaleSuffix(preferredLocale, false),
      new LocaleSuffix(preferredLocale, true),
  };
  return locales;
}
origin: jsettlers/settlers-remake

  @Override
  protected InputStream getLocaleStream(LocaleSuffix locale) throws IOException {
    String filename = locale.getFileName("labels", ".properties");

    InputStream stream = ExceptionLabels.class.getResourceAsStream(filename);
    if (stream == null) {
      throw new FileNotFoundException(filename);
    }
    return stream;
  }
}
origin: jsettlers/settlers-remake

  @Override
  protected InputStream getLocaleStream(LocaleSuffix locale) throws IOException {
    String filename = locale.getFileName("labels", ".properties");

    InputStream stream = EditorLabels.class.getResourceAsStream(filename);
    if (stream == null) {
      throw new FileNotFoundException(filename);
    }
    return stream;
  }
}
jsettlers.graphics.localizationAbstractLabels$LocaleSuffix

Javadoc

This defines a locale suffix (like _en_US).

Most used methods

  • getFileName
    Creates a file name with this suffix.
  • <init>
    Creates a new locale suffix object.
  • getLocale
    Gets the locale used.

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now