Class OStrings

java.lang.Object
org.omegat.util.OStrings

public final class OStrings extends Object
Localizable strings.

Please don't add any new strings here, use getString method. This class still has so many strings for legacy reasons only.

  • Field Details

    • BRANDING

      public static final String BRANDING
      For custom deployments of OmegaT that need to be distinguishable from "stock" OmegaT
      See Also:
    • VERSION

      public static final String VERSION
      Just a version, e.g. "1.6"
    • UPDATE

      public static final String UPDATE
      Update number, e.g. 2, for 1.6.0_02
    • REVISION

      public static final String REVISION
      Repository revision number, e.g. r7500
    • IS_BETA

      public static final boolean IS_BETA
      Indicates whether this is a "beta" (or "latest") version or a "standard" version.
  • Method Details

    • getResourceBundle

      public static ResourceBundle getResourceBundle()
      Returns resource bundle.
    • loadBundle

      public static void loadBundle(Locale locale)
      Loads resources with the specified locale.
      Parameters:
      locale - Locale to load.
    • loadBundle

      public static void loadBundle(String filename)
      Loads resources from the specified file. If the file cannot be loaded, resources are reverted to the default locale. Useful when testing localisations outside the jar file.
    • getString

      public static String getString(String key)
      Returns a localized String for a key
    • getString

      public static String getString(String key, Object... formatArgs)
      Returns a localized string for a key, formatted with the given arguments. Formatting is done by StringUtil.format(String, Object...).
    • getApplicationDisplayName

      public static String getApplicationDisplayName()
      Get the application name for display purposes (includes branding)
    • getApplicationName

      public static String getApplicationName()
      Get the raw application name (suitable for file paths, etc.; includes branding)
    • getBrandingToken

      public static String getBrandingToken()
      Get the token for identifying stock vs branded OmegaT files. Intended to be used in filenames, etc. Is the empty string if BRANDING is empty.
    • getDisplayNameAndVersion

      public static String getDisplayNameAndVersion()
      Returns the OmegaT "pretty" version for display (includes the application name). Example: "OmegaT 3.5", "OmegaT 3.5.1_2"
    • getNameAndVersion

      public static String getNameAndVersion()
      Returns the OmegaT full version for logs, etc. (includes the application name). Example: "OmegaT-3.5_0_dev", "OmegaT-3.5.1_0_r7532"
    • getVersion

      public static String getVersion()
      Returns the OmegaT full version for logs, etc. (does not include the application name). Example: "3.5_0_dev", "3.5.1_0_r7532"
    • getSimpleVersion

      public static String getSimpleVersion()
      Returns the OmegaT simple version for displaying to the user for comparison e.g. in a version update message. Does not include the revision because the revision is not guaranteed to be consistent across binaries in a single release. Example: "3.5.0", "3.5.1_1"
    • getSimpleVersion

      public static String getSimpleVersion(String version, String update)
    • getProgressBarDefaultPrecentageText

      public static String getProgressBarDefaultPrecentageText()
      Returns default text for progress bar when no project is loaded
    • getSegmentMarker

      public static String getSegmentMarker()
      Returns the textual marker for the current segment. NOTE: segment marker is assumed to contain "0000" string to overwrite with entry number. If zeros not detected, entry number will not be displayed
    • validateVersion

      public static void validateVersion(Function<String,String> map)
      Check to make sure the given Properties contains valid information about an OmegaT version. See Version.properties for more info.
      Parameters:
      map - A function that accepts a key and returns a value
      Throws:
      IllegalArgumentException - If the version info is invalid