Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

E4/EAS/String Localization

< E4‎ | EAS
Revision as of 21:50, 23 October 2009 by Remysuen.ca.ibm.com (Talk | contribs) (New page: String localization is an important part of any product that markets itself for an international audience and the Eclipse platform is no different. As the Eclipse platform extends itself t...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

String localization is an important part of any product that markets itself for an international audience and the Eclipse platform is no different. As the Eclipse platform extends itself to other avenues beyond the desktop, it must continue to ensure that NLS is present. It must be possible for contributions, dynamically contributed through a plugin.xml or in code, to be localized. See bug 226340 and bug 244468 for more information.

Eclipse 3.x API

In Eclipse 3.x, clients use the NLS API to populate strings with their localized content and for providing arguments to their messages.

Populating the strings:

package org.eclipse.e4.internal.core.localization;
 
public class Messages extends NLS {
 
  private static final String BUNDLE_NAME = "org.eclipse.e4.internal.core.localization.messages"; //$NON-NLS-1$
 
  public static String Some_Message_With_Arguments;
 
  static {
    NLS.initializeMessages(BUNDLE_NAME, Messages.class);
  }
}

Using the strings:

text.setText(NLS.bind(Messages.Some_Message_With_Arguments, "org.eclipse.e4.core", "E4");

Copyright © Eclipse Foundation, Inc. All Rights Reserved.