Java resource bundle

Last updated

A resource bundle is a Java .properties file that contains locale-specific data. [1] It is a way of internationalising a Java application by making the code locale-independent.

Contents

Benefits of using resource bundles

Extracting locale-sensitive objects such as strings from the code (as opposed to hard-coding them) means that the application can handle multiple locales without having to write different code for each locale. It also means that translators can deal with just the translatable text and not the programming code. Therefore, using resource bundles improves the internationalisation and the localisation process of a software product.

Translating a resource bundle

Some CAT tools like OmegaT, OmegaT+, [2] Swordfish or Sun's Open language tools can specifically handle resource bundles. In addition to these, translators can use any text editor to create new resource bundles or to modify existing ones.

Tools to create resource bundles

The Message Compiler [3] is a tool to generate resource bundle files from a single source file containing localized text definitions in different languages. The Message Compiler creates also constant definitions for the keys used to access the localized texts with the methods of the Java class ResourceBundle (6), ResourceBundle (7) and HTML documentation pages for each language.

See also

Related Research Articles

Java (programming language) Object-oriented programming language

Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client-server web applications, with a reported 9 million developers.

The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between systems on different operating systems, programming languages, and computing hardware. CORBA uses an object-oriented model although the systems that use the CORBA do not have to be object-oriented. CORBA is an example of the distributed object paradigm.

Cocoa is Apple's native object-oriented application programming interface (API) for its desktop operating system macOS.

In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing - during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. It is provided by specialized programming language constructs, hardware mechanisms like interrupts, or operating system (OS) inter-process communication (IPC) facilities like signals. Some exceptions, especially hardware ones, may be handled so gracefully that execution can resume where it was interrupted.

Internationalization and localization Process of making software accessible to people in different areas of the world

In computing, internationalization and localization (American) or internationalisation and localisation (BrE) are means of adapting computer software to different languages, regional peculiarities and technical requirements of a target locale. Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for a specific region or language by translating text and adding locale-specific components. Localization uses the infrastructure or flexibility provided by internationalization.

The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the data fork.

Eclipse (software) Java software development environment

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages via plug-ins, including Ada, ABAP, C, C++, C#, Clojure, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Lasso, Lua, NATURAL, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, and Scheme. It can also be used to develop documents with LaTeX and packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.

In software engineering, the terms front end and back end refer to the separation of concerns between the presentation layer, and the data access layer of a piece of software, or the physical infrastructure or hardware. In the client–server model, the client is usually considered the front end and the server is usually considered the back end, even when some presentation work is actually done on the server itself.

In computing, gettext is an internationalization and localization system commonly used for writing multilingual programs on Unix-like computer operating systems. One of the main benefits of gettext is that it separates programming from translating. The most commonly used implementation of gettext is GNU gettext, released by the GNU Project in 1995. The runtime library is libintl. gettext provides an option to use different strings for any number of plural forms of nouns, but it has no support for grammatical gender.

International Components for Unicode (ICU) is an open-source project of mature C/C++ and Java libraries for Unicode support, software internationalization, and software globalization. ICU is widely portable to many operating systems and environments. It gives applications the same results on all platforms and between C, C++, and Java software. The ICU project is a technical committee of the Unicode Consortium and sponsored, supported, and used by IBM and many other companies.

VisualWorks is a cross-platform implementation of the Smalltalk language. It is implemented as a development system based on "images", which are dynamic collections of software objects, each contained in a system image.

In NeXTSTEP, OPENSTEP, GNUstep, and their lineal descendants macOS and iOS, a bundle is a file directory with a defined structure and file extension, allowing related files to be grouped together as a conceptually single item.

Uniface (programming language) Low-code development platform

Uniface is a low-code development and deployment platform for enterprise applications that can run in a large range of runtime environments, including mobile, mainframe, web, Service-oriented architecture (SOA), Windows, Java EE and .NET. Uniface is a model-driven, Rapid Application Development (RAD) environment used to create mission-critical applications.

In the Java programming language a resource is a piece of data that can be accessed by the code of an application.

OmegaT Computer assisted translation tool written in Java

OmegaT is a computer-assisted translation tool written in the Java programming language. It is free software originally developed by Keith Godfrey in 2000, and is currently developed by a team led by Aaron Madlon-Kay.

.properties is a file extension for files mainly used in Java-related technologies to store the configurable application. They can also be used for storing strings for Internationalization and localization; these are known as Property Resource Bundles.

Google Web Toolkit

Google Web Toolkit, or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. Other than a few native libraries, everything is Java source that can be built on any supported platform with the included GWT Ant build files. It is licensed under the Apache License 2.0.

The Windows software trace preprocessor is a preprocessor that simplifies the use of WMI event tracing to implement efficient software tracing in drivers and applications that target Windows 2000 and later operating systems. WPP was created by Microsoft and is included in the Windows DDK. Although WPP is wide in its applicability, it is not included in the Windows SDK, and therefore is primarily used for drivers and driver support software produced by software vendors that purchase the Windows DDK.

SDL Trados Studio is a computer-assisted translation software suite, a successor to the older Translators Workbench originally developed by the German company Trados GmbH and currently available from SDL plc, a provider of customer experience cloud solutions. It is considered the market leader in providing translation software across the entire translation supply chain, including freelance translators, language service providers, corporate language departments and academic institutions.

Open Language Tools is a Java project released by Sun Microsystems under the terms of Sun’s CDDL.

References

  1. O'Conner, John. "Java Internationalization: Localization with ResourceBundles". Sun Developer Network. Archived from the original on 2007-01-03. Retrieved 2020-11-16.
  2. OmegaT+
  3. Message Compiler