Hi Suraj,
One workaround is to create a JSON file for each language you want to support. Create the JSON with translated strings for that language. The structure should match the previously created customTab.json. Once all the JSON files are ready, in your sl_toolstrip_plugins.json, add a new property for each supported language. The value of each property will be the path to the corresponding file. Following is a sample example of the json file:
{
"en_US": "path/to/customTab_en_US.json",
"fr": "path/to/customTab_fr.json"
...
}
When MATLAB starts, you need to load the appropriate file based on the current language setting. You can get the current language and then use the returned language code to select the appropriate file from your sl_toolstrip_plugins.json file. This can be done with the following sample script:
currentLanguage = get(0,'Language');
% Load the appropriate file
if strcmp(currentLanguage, 'en_US')
customTabFile = 'path/to/customTab_en_US.json';
elseif strcmp(currentLanguage, 'fr')
customTabFile = 'path/to/customTab_fr.json';
else
error('Unsupported language');
end
% Load the tab using your custom function and the customTabFile variable
This is a high-level approach and the exact implementation can vary depending on the specifics of your project and the version of MATLAB you are using.