Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Cannot localize VSIX Project

$
0
0
Hello, I'm trying to create a small and useful visual studio extension, using visx project.
(My Visual Studio Version is 2019 Enterprise 2019 Preview Version 16.2.0 Preview 1.0)
What I really suffer is I cannot localize this project.
The guidance which I referred to and followed was the MSDocument site, below.
--------
Prerequisites
--------
To focus the problem, I made a very simple Vsix project named "VsixLocalizeTrial", 
and added a CustomCommand named "TestCommand01" which shows Information alert message
when the menu is clicked. (I localized the first line of message, using .resx file, and it works fine.)

I'm trying to localize just the button text of this MenuItem.

To do so, I copied the "VsixLocalizeTrialPackage.vsct" file and pasted it to it's Spanish, Japanese, and English corresponding vsct files (VsixLocalizeTrialPackage.en-US.vsct, VsixLocalizeTrialPackage.es-ES.vsct, VsixLocalizeTrialPackage.ja-JP.vsct) . I changed the button text of TestCommand01Id to the native expression for their corresponding language.

Then I closed the project in Visual Studio, opned the csproj file by other editor, and adjusted the VSCTCompile element, add a ResourceName element that points to Menus.ctmenu, as follows.
<ItemGroup>  <VSCTCompile Include="VsixLocalizeTrialPackage.vsct">    <ResourceName>Menus.ctmenu</ResourceName>  </VSCTCompile>  <VSCTCompile Include="VsixLocalizeTrialPackage.en-US.vsct">    <ResourceName>Menus.ctmenu</ResourceName>  </VSCTCompile>  <VSCTCompile Include="VsixLocalizeTrialPackage.es-ES.vsct">    <ResourceName>Menus.ctmenu</ResourceName>  </VSCTCompile>  <VSCTCompile Include="VsixLocalizeTrialPackage.ja-JP.vsct">    <ResourceName>Menus.ctmenu</ResourceName>  </VSCTCompile></ItemGroup>

What I expect is that I can see localized "Invoke TestCommand01" command menu
just below the "Tool" menu, in the experimental Visual Studio instance,
when Debbug begins.

--------
Symptoms
--------

I can see "Invoke TestCommand01"menu which is not localized.
So, in accordance with the advice in the MSDocs, I've added the entry at the bottom of the AssemblyInfo fie of the vsix as follows.
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
→[assembly: NeutralResourcesLanguage("es-ES", UltimateResourceFallbackLocation.Satellite)]
→[assembly: NeutralResourcesLanguage("ja-JP", UltimateResourceFallbackLocation.Satellite)]

I tried it to set the packages default language.

When I set this, to my surprise, menu "Invoke TestCommand01" did not appears at all.

--------
What I'd like to know
--------

I'm wondering if I can really localize vsix custom menucommand in with this process.
I'm afraid I miss some very important procedure.

I have uploaded above simple program to the github.
https://github.com/TrailRunner-MF/Experimental

It's a very simple program just focus on the localization of vsct files.

I'll appreciate any advice or hint or example relating to this complicated problem.

Thank you.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>