Internationalization Support

Questions & Answers

Summary

Overview on the internationalization (i18n) and the localization (l10n) support in the yFiles product family.
For a better user experience, please go to the integrated documentation viewer to read this article.

Description

There are basically two parts to i18n support and l10n in an application that uses one of the diagramming libraries of the yFiles product family:

  • the graph representation itself: this includes the visual representation of node labels and edge labels, but also their representation when saving a graph to a graph exchange file format like GraphML
  • the user interface (UI) of an application: this includes text of UI elements like buttons, etc.

yFiles for Java

  • graph representation:
    i18n support for displaying labels is provided by the Java Runtime Environment in conjunction with a suitable font that contains the correct glyphs for a specific language. With Java version 5.0 and greater, Java's logical font "Dialog" covers most glyphs available on current operating system installations.
    The following figure shows a simple graph created using the yEd graph editor on a default Windows XP installation with JRE 6.
    Hello World localization
    Saving and loading of localized diagrams with GraphML is fully supported. The GraphML file that encodes this graph is available as a resource to this article, see below.

    From the following excerpt, you can see that the GraphML file contains the localized label text encoded in UTF-8 (Unicode Transformation Format). Carefully observe that the glyphs of any label text are stored left-to-right, the proper direction for the text is recognized by the JRE and is accounted for when the text is actually rendered.

    Localized Hello World GraphML excerpt
    This other Knowledge Base article explains further aspects of using Unicode representation in labels.

  • user interface:
    i18n support in and l10n of the user interface of a Java application in general is described in the Java Tutorial, for example. The Java Internationalization page and the Internationalization FAQ provide extensive information on all aspects of i18n support in Java.
    The settings dialogs and components that come as part of yFiles for Java provide i18n support as described in the yFiles for Java Developer's Guide: Internationalization and Localization
    In particular, l10n is achieved by means of .properties files as presented in the OptionHandlerDemo.

Note that exporting the visual representation of a graph using the yFiles extension package yExport currently yields incorrect results for languages that are written right-to-left, like, e.g., Hebrew or Arabic.

yFiles.NET

  • graph representation:
    i18n support for displaying the label depends on the actual label style used, as well as on the availability of suitable fonts that contain the correct glyphs for a specific language. The default implementations for the ILabelStyle interface support arbitrary fonts as well as all text orientations that exist for the .NET framework.
    Saving and loading localized diagrams with GraphML is also fully supported. For interactive label editing, a standard Windows Forms TextBoxBase implementation is used by default, which can be customized with standard .NET framework methods.
  • user interface:
    The OptionHandler framework provides i18n support through interface yWorks.Option.I18N.I18NFactory. There is a default implementation that can use the .NET ResourceManager class for l10n. Since the available interactive editors are based on either .NET Labels or the .NET PropertyGrid, display support for vertical text orientations is limited by the capabilities of these components.

yFiles WPF

In addition to the i18n support in yFiles.NET, yFiles WPF also provides several predefined command bindings. To change the text for these bindings, you need to wrap these bindings by your own commands that use the localized text instead.

Please note that support for vertical text orientations in yFiles WPF is currently rather limited due to limitations in the WPF framework itself.

yFiles FLEX

  • graph representation:
    i18n support for displaying labels is provided by the Flash Player in conjunction with a suitable font that contains the correct glyphs for a specific language. If you need to embed a font for a specific language in your yFiles FLEX-based application, please see this Knowledge Base article.
  • user interface:
    i18n support and l10n for UI elements is described in this technical article from Adobe Labs: Flex 3: Runtime Localization

yFiles AJAX

  • graph representation:
    in a yFiles AJAX client/server application the client displays image tiles generated by a yFiles for Java servlet, i.e., the i18n support and l10n techniques of Java as described above are relevant.
  • user interface:
    yFiles AJAX uses the Dojo toolkit on the client, which provides i18n support for UI elements as described here: Internationalization Quickstart.

Resources

Categories this article belongs to:
yFiles AJAX > Other
yFiles FLEX > Other
yFiles for Java > Other
yFiles WPF > Other
yFiles.NET > Other
Applies to:
yFiles for Java 2: 2.6, 2.7, 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18
yFiles.NET: 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3
yFiles WPF: 1.0, 2.0, 2.1, 2.2, 2.3, 2.4
yFiles FLEX: 1.5, 1.6, 1.7, 1.8
yFiles AJAX: 1.1, 1.2, 1.3, 1.4, 2.0
Keywords:
internationalization - i18n - localization - l10n - resource - bundle - localized - GraphML