Package org.omegat.util
Class OStrings
- java.lang.Object
-
- org.omegat.util.OStrings
-
public final class OStrings extends java.lang.ObjectLocalizable strings.Please don't add any new strings here, use
getStringmethod. This class still has so many strings for legacy reasons only.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBRANDINGFor custom deployments of OmegaT that need to be distinguishable from "stock" OmegaTstatic booleanIS_BETAIndicates whether this is a "beta" (or "latest") version or a "standard" version.static java.lang.StringREVISIONRepository revision number, e.g.static java.lang.StringUPDATEUpdate number, e.g.static java.lang.StringVERSIONJust a version, e.g.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetApplicationDisplayName()Get the application name for display purposes (includes branding)static java.lang.StringgetApplicationName()Get the raw application name (suitable for file paths, etc.; includes branding)static java.lang.StringgetBrandingToken()Get the token for identifying stock vs branded OmegaT files.static java.lang.StringgetDisplayNameAndVersion()Returns the OmegaT "pretty" version for display (includes the application name).static java.lang.StringgetNameAndVersion()Returns the OmegaT full version for logs, etc.static java.lang.StringgetProgressBarDefaultPrecentageText()Returns default text for progress bar when no project is loadedstatic java.util.ResourceBundlegetResourceBundle()Returns resource bundle.static java.lang.StringgetSegmentMarker()Returns the textual marker for the current segment.static java.lang.StringgetSimpleVersion()Returns the OmegaT simple version for displaying to the user for comparison e.g.static java.lang.StringgetSimpleVersion(java.lang.String version, java.lang.String update)static java.lang.StringgetString(java.lang.String key)Returns a localized String for a keystatic java.lang.StringgetString(java.lang.String key, java.lang.Object... formatArgs)Returns a localized string for a key, formatted with the given arguments.static java.lang.StringgetVersion()Returns the OmegaT full version for logs, etc.static voidloadBundle(java.lang.String filename)Loads resources from the specified file.static voidvalidateVersion(java.util.function.Function<java.lang.String,java.lang.String> map)Check to make sure the given Properties contains valid information about an OmegaT version.
-
-
-
Field Detail
-
BRANDING
public static final java.lang.String BRANDING
For custom deployments of OmegaT that need to be distinguishable from "stock" OmegaT- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
Just a version, e.g. "1.6"
-
UPDATE
public static final java.lang.String UPDATE
Update number, e.g. 2, for 1.6.0_02
-
REVISION
public static final java.lang.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 Detail
-
getResourceBundle
public static java.util.ResourceBundle getResourceBundle()
Returns resource bundle.
-
loadBundle
public static void loadBundle(java.lang.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 java.lang.String getString(java.lang.String key)
Returns a localized String for a key
-
getString
public static java.lang.String getString(java.lang.String key, java.lang.Object... formatArgs)Returns a localized string for a key, formatted with the given arguments. Formatting is done byStringUtil.format(String, Object...).
-
getApplicationDisplayName
public static java.lang.String getApplicationDisplayName()
Get the application name for display purposes (includes branding)
-
getApplicationName
public static java.lang.String getApplicationName()
Get the raw application name (suitable for file paths, etc.; includes branding)
-
getBrandingToken
public static java.lang.String getBrandingToken()
Get the token for identifying stock vs branded OmegaT files. Intended to be used in filenames, etc. Is the empty string ifBRANDINGis empty.
-
getDisplayNameAndVersion
public static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getSimpleVersion(java.lang.String version, java.lang.String update)
-
getProgressBarDefaultPrecentageText
public static java.lang.String getProgressBarDefaultPrecentageText()
Returns default text for progress bar when no project is loaded
-
getSegmentMarker
public static java.lang.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(java.util.function.Function<java.lang.String,java.lang.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:
java.lang.IllegalArgumentException- If the version info is invalid
-
-