November Happy Hour will be moved to Thursday December 5th.

How to get translation text for button title in TinyMCE Plugin?

Vote:
 

Hi,

I create sample button to add to TinyMce editor. Could you please to enlighten me how to get translation text for button title from resource file?

I'm using EPiServer 11.9.2, EPiServer.Cms.TinyMce 2.6.0

//Path: Business/Initialization/MyAwesomeTinyMcePluginInitialization.cs
[ModuleDependency(typeof(TinyMceInitialization))]
public class MyAwesomeTinyMcePluginInitialization : IConfigurableModule
{
	public void Initialize(InitializationEngine context){}

	public void Uninitialize(InitializationEngine context){}

	public void ConfigureContainer(ServiceConfigurationContext context)
	{
		context.Services.Configure(config =>
		{
			config.Default().AddExternalPlugin("myawesometinymceplugin", "/ClientResources/Scripts/Editors/myawesometinymceplugin.js")
				.AppendToolbar("myawesometinymceplugin");
		});
	}
}
//File path: /ClientResources/Scripts/Editors/myawesometinymceplugin.js
tinymce.PluginManager.add('myawesometinymceplugin',
    function (editor) {
        
        // Register buttons
        editor.addButton("myawesometinymceplugin",
            {
                title: "myawesometinymceplugin.myawesometinymceplugin_desc",
                cmd: "mceMyAwesomeTinyMcePlugin",
                image: "/ClientResources/Images/icons/myawesometinymcepluginicon.png",
                onPostRender: function () {
                    
                }
            });

        editor.shortcuts.add("ctrl+p",
            "myawesometinymceplugin.myawesometinymceplugin_desc",
            function () {
                editor.execCommand("mceMyAwesomeTinyMcePlugin");
            });


        return {
            getMetadata: function () {
                return {
                    longname: "my awesome tiny mce plugin",
                    author: "Me",
                    version: "1.0"
                };
            }
        };
    });


Path: Resources/LanguageFiles/myawesometinymceplugin.xml


  
    
      
        Create a hightlight Link (Ctrl+P)
        Here you can create a hightlight Link
      
    
  

Path: web.config


  
	
  
#195437
Jul 25, 2018 9:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.