How to localize WPF Application with RESX files in subdirectories Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Put translated resx files in a different folder in Visual Studio?What is the correct way to create a single-instance WPF application?.net localization: coexistence of old-school .resx and new-school wpf .bamlMain assembly versus Satellite assembly problems when fetching both XAML and RESX resources in C# .NetCould not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)XAML Resx localization not working as expectedLocalization resx files in separate assembly?Is there a way to regenerate a missing .resx file?Can't find “Resources” file in wpfI can not seem to reach .resx WPFCannot use resx files if their are in another project
Short story about astronauts fertilizing soil with their own bodies
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
systemd and copy (/bin/cp): no such file or directory
Noise in Eigenvalues plot
NIntegrate on a solution of a matrix ODE
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
One-one communication
How to make triangles with rounded sides and corners? (squircle with 3 sides)
Trying to understand entropy as a novice in thermodynamics
Releasing Patch File for BSD3 Licensed Project
Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?
Does the transliteration of 'Dravidian' exist in Hindu scripture? Does 'Dravida' refer to a Geographical area or an ethnic group?
Twin's vs. Twins'
How do you write "wild blueberries flavored"?
Sally's older brother
Can haste grant me and my beast master companion extra attacks?
How much damage would a cupful of neutron star matter do to the Earth?
newbie Q : How to read an output file in one command line
Marquee sign letters
Where and when has Thucydides been studied?
Why are current probes so expensive?
Find general formula for the terms
In musical terms, what properties are varied by the human voice to produce different words / syllables?
What does 丫 mean? 丫是什么意思?
How to localize WPF Application with RESX files in subdirectories
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Put translated resx files in a different folder in Visual Studio?What is the correct way to create a single-instance WPF application?.net localization: coexistence of old-school .resx and new-school wpf .bamlMain assembly versus Satellite assembly problems when fetching both XAML and RESX resources in C# .NetCould not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)XAML Resx localization not working as expectedLocalization resx files in separate assembly?Is there a way to regenerate a missing .resx file?Can't find “Resources” file in wpfI can not seem to reach .resx WPFCannot use resx files if their are in another project
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
My team has some WPF projects written using XAML. We recently added a large number of local specific RESX files to each project. In order to keep things tidy, I was asked to store these files in [Project]>Localization>[locale]
Now, when we run the application on a non en-US locale, strings are pulled from the appropriate RESX file. We've tried to update Namespaces in the properties of the RESX files, as well as setting them to Public so that a resulting Designer is created.
The only way that we can get things to work is by moving the locale RESX files directly into the Project's Properties directory.
Is there anyway to update the XAML to search for locale RESX files in a subdirectory?
EDIT
XAML Codebase and Solution Explorer
I've attached an image of the problem for clarification.
Some code changes that we've tried:
1) We attempted to set the Namespace for xmlns:res="clr-namespace:[PROJECT].CoreUI.Localization"
2) Attempted to set the Namespace to xmlns:res="clr-namespace:[PROJECT].CoreUI"
3) We've also attempted to change the Custom Tool Namespace of the RESX file to match the current namespace My.Properties as well as CoreUI.Properties
We've also confirmed that the Access Modifiers for both Resources.resx and Resources.ru.resx (for example) are set to Public and that both Build Actions show "Embedded Resource"
c# wpf localization resx
add a comment |
My team has some WPF projects written using XAML. We recently added a large number of local specific RESX files to each project. In order to keep things tidy, I was asked to store these files in [Project]>Localization>[locale]
Now, when we run the application on a non en-US locale, strings are pulled from the appropriate RESX file. We've tried to update Namespaces in the properties of the RESX files, as well as setting them to Public so that a resulting Designer is created.
The only way that we can get things to work is by moving the locale RESX files directly into the Project's Properties directory.
Is there anyway to update the XAML to search for locale RESX files in a subdirectory?
EDIT
XAML Codebase and Solution Explorer
I've attached an image of the problem for clarification.
Some code changes that we've tried:
1) We attempted to set the Namespace for xmlns:res="clr-namespace:[PROJECT].CoreUI.Localization"
2) Attempted to set the Namespace to xmlns:res="clr-namespace:[PROJECT].CoreUI"
3) We've also attempted to change the Custom Tool Namespace of the RESX file to match the current namespace My.Properties as well as CoreUI.Properties
We've also confirmed that the Access Modifiers for both Resources.resx and Resources.ru.resx (for example) are set to Public and that both Build Actions show "Embedded Resource"
c# wpf localization resx
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53
add a comment |
My team has some WPF projects written using XAML. We recently added a large number of local specific RESX files to each project. In order to keep things tidy, I was asked to store these files in [Project]>Localization>[locale]
Now, when we run the application on a non en-US locale, strings are pulled from the appropriate RESX file. We've tried to update Namespaces in the properties of the RESX files, as well as setting them to Public so that a resulting Designer is created.
The only way that we can get things to work is by moving the locale RESX files directly into the Project's Properties directory.
Is there anyway to update the XAML to search for locale RESX files in a subdirectory?
EDIT
XAML Codebase and Solution Explorer
I've attached an image of the problem for clarification.
Some code changes that we've tried:
1) We attempted to set the Namespace for xmlns:res="clr-namespace:[PROJECT].CoreUI.Localization"
2) Attempted to set the Namespace to xmlns:res="clr-namespace:[PROJECT].CoreUI"
3) We've also attempted to change the Custom Tool Namespace of the RESX file to match the current namespace My.Properties as well as CoreUI.Properties
We've also confirmed that the Access Modifiers for both Resources.resx and Resources.ru.resx (for example) are set to Public and that both Build Actions show "Embedded Resource"
c# wpf localization resx
My team has some WPF projects written using XAML. We recently added a large number of local specific RESX files to each project. In order to keep things tidy, I was asked to store these files in [Project]>Localization>[locale]
Now, when we run the application on a non en-US locale, strings are pulled from the appropriate RESX file. We've tried to update Namespaces in the properties of the RESX files, as well as setting them to Public so that a resulting Designer is created.
The only way that we can get things to work is by moving the locale RESX files directly into the Project's Properties directory.
Is there anyway to update the XAML to search for locale RESX files in a subdirectory?
EDIT
XAML Codebase and Solution Explorer
I've attached an image of the problem for clarification.
Some code changes that we've tried:
1) We attempted to set the Namespace for xmlns:res="clr-namespace:[PROJECT].CoreUI.Localization"
2) Attempted to set the Namespace to xmlns:res="clr-namespace:[PROJECT].CoreUI"
3) We've also attempted to change the Custom Tool Namespace of the RESX file to match the current namespace My.Properties as well as CoreUI.Properties
We've also confirmed that the Access Modifiers for both Resources.resx and Resources.ru.resx (for example) are set to Public and that both Build Actions show "Embedded Resource"
c# wpf localization resx
c# wpf localization resx
edited Mar 11 at 14:00
Jeffrey Upton
asked Mar 9 at 0:35
Jeffrey UptonJeffrey Upton
164
164
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53
add a comment |
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53
add a comment |
1 Answer
1
active
oldest
votes
Thanks for the help!
My colleague actually stumbled upon another post in here that we somehow missed during out countless searching:
Put translated resx files in a different folder in Visual Studio?
In short, we were thinking about making the project search down into subdirectories for the RESX files. In actuality, we need the RESX file to search for the already created designer further up in the chain.
<ItemGroup>
<EmbeddedResource Include="LocalizationarResources.ar.resx" >
<ManifestResourceName>$(TargetName).Properties.%(Filename)</ManifestResourceName>
</EmbeddedResource>
Entering the ManifestResourceName appears to tell the RESX file that we already have a Designer created and not to make a new one.
Thanks again for everyone's help!
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072839%2fhow-to-localize-wpf-application-with-resx-files-in-subdirectories%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for the help!
My colleague actually stumbled upon another post in here that we somehow missed during out countless searching:
Put translated resx files in a different folder in Visual Studio?
In short, we were thinking about making the project search down into subdirectories for the RESX files. In actuality, we need the RESX file to search for the already created designer further up in the chain.
<ItemGroup>
<EmbeddedResource Include="LocalizationarResources.ar.resx" >
<ManifestResourceName>$(TargetName).Properties.%(Filename)</ManifestResourceName>
</EmbeddedResource>
Entering the ManifestResourceName appears to tell the RESX file that we already have a Designer created and not to make a new one.
Thanks again for everyone's help!
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
add a comment |
Thanks for the help!
My colleague actually stumbled upon another post in here that we somehow missed during out countless searching:
Put translated resx files in a different folder in Visual Studio?
In short, we were thinking about making the project search down into subdirectories for the RESX files. In actuality, we need the RESX file to search for the already created designer further up in the chain.
<ItemGroup>
<EmbeddedResource Include="LocalizationarResources.ar.resx" >
<ManifestResourceName>$(TargetName).Properties.%(Filename)</ManifestResourceName>
</EmbeddedResource>
Entering the ManifestResourceName appears to tell the RESX file that we already have a Designer created and not to make a new one.
Thanks again for everyone's help!
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
add a comment |
Thanks for the help!
My colleague actually stumbled upon another post in here that we somehow missed during out countless searching:
Put translated resx files in a different folder in Visual Studio?
In short, we were thinking about making the project search down into subdirectories for the RESX files. In actuality, we need the RESX file to search for the already created designer further up in the chain.
<ItemGroup>
<EmbeddedResource Include="LocalizationarResources.ar.resx" >
<ManifestResourceName>$(TargetName).Properties.%(Filename)</ManifestResourceName>
</EmbeddedResource>
Entering the ManifestResourceName appears to tell the RESX file that we already have a Designer created and not to make a new one.
Thanks again for everyone's help!
Thanks for the help!
My colleague actually stumbled upon another post in here that we somehow missed during out countless searching:
Put translated resx files in a different folder in Visual Studio?
In short, we were thinking about making the project search down into subdirectories for the RESX files. In actuality, we need the RESX file to search for the already created designer further up in the chain.
<ItemGroup>
<EmbeddedResource Include="LocalizationarResources.ar.resx" >
<ManifestResourceName>$(TargetName).Properties.%(Filename)</ManifestResourceName>
</EmbeddedResource>
Entering the ManifestResourceName appears to tell the RESX file that we already have a Designer created and not to make a new one.
Thanks again for everyone's help!
answered Mar 12 at 13:23
Jeffrey UptonJeffrey Upton
164
164
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
add a comment |
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
Just to add to this, I edited the project so that it's a little more future-proof for any new languages. <EmbeddedResource Include="Localization***.resx" > allows me to import all of the resx files and use the manifest reference for any newly added resx files.
– Jeffrey Upton
Mar 12 at 14:18
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072839%2fhow-to-localize-wpf-application-with-resx-files-in-subdirectories%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What coding attempts have you made so far? Please update your question with all code that is relevant to your question.
– Caleb Goodman
Mar 9 at 0:44
Please check the Build Action of the Resx Files. Is there any difference when the files are in different folders other than Properties?
– kennyzx
Mar 9 at 0:53