Interface PluginResourceBundle


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface PluginResourceBundle
    Bundle used to translate specific messages in the language set in the editor's preferences. The translation file must be located in a directory named "i18n", placed in the plugin's root directory. The translation file name must be: translation*.xml Here is a small sample of an translation XML file structure:
     
     <?xml version="1.0" encoding="UTF-8"?>
     <translation>
        <key value="key_name">
           <comment>key description</comment>
          <val lang="en_US">en_US_translation</val>
          <val lang="de_DE">de_DE_translation</val>
          <val lang="fr_FR">fr_FR_translation</val>
          <val lang="ja_JP">ja_JP_translation</val>
          <val lang="nl_NL">nl_NL_translation</val>
      </key>
     </translation>
     
     
    Since:
    18.1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getMessage​(java.lang.String messageKey)
      Get the internationalized message corresponding to the specified key.
    • Method Detail

      • getMessage

        java.lang.String getMessage​(java.lang.String messageKey)
        Get the internationalized message corresponding to the specified key.
        Parameters:
        messageKey - The key of the message which is accessed. In the following translation XML sample, the "messageKey" that you can be used to get the message translation is "key_name":
         
         <?xml version="1.0" encoding="UTF-8"?>
         <translation>
             <languageList>
               <language description="English US" lang="en_US"/>
               <language description="German" lang="de_DE"/>
               <language description="French" lang="fr_FR"/>
            </languageList>
            <key value="key_name1">
               <comment>key description1</comment>
              <val lang="en_US">en_US_translation1</val>
              <val lang="de_DE">de_DE_translation1</val>
              <val lang="fr_FR">fr_FR_translation1</val>
          </key>
           <key value="key_name2">
               <comment>key description2</comment>
              <val lang="en_US">en_US_translation2</val>
              <val lang="de_DE">de_DE_translation2</val>
              <val lang="fr_FR">fr_FR_translation2</val>
          </key>
          ........................
         </translation>
         
         
        Returns:
        The internationalized message representing the specified key in the language of this bundle.
        Throws:
        java.lang.ClassCastException - if the object found for the given key is not a string