Locbaml 是如何工作的? [英] How does Locbaml work?

查看:27
本文介绍了Locbaml 是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 WPF 测试项目,其中有一个按钮的单个窗口.然后我卸载了项目并修改了 csproj 以包含以下 en-US.重建后,构建文件夹现在包含一个名为 en-US 的子文件夹,它包含一个名为 WpfLocalizationTest.resources.dll 的文件.到目前为止一切都清楚.

I created a WPF test project, single Window with a single button in it. I then unloaded the project and modified the csproj to contain the following <UICulture>en-US</UICulture>. After rebuilding the build folder now contains a subfolder named en-US and it contains a file called WpfLocalizationTest.resources.dll. All clear so far.

然后我下载了 Locbaml 的源代码并构建了它.(在任何地方都找不到二进制下载,去图.)

Then I downloaded the source code for Locbaml and built it. (Couldn't find a binary download anywhere, go figure.)

然后我将 Locbaml.exe 复制到 en-US 文件夹并尝试了以下操作.

Then I copied the Locbaml.exe to the en-US folder and tried the following.

locbaml /parse WpfLocalizationTest.resources.dll /out:test.csv

这会导致错误无法加载文件或程序集 WpfLocalizationTest.resources.dll 或其依赖项之一.试图加载格式不正确的程序.'

This results in an error 'Could not load file or assembly WpfLocalizationTest.resources.dll or one of its dependencies. An attempt was made to load a program with an incorrect format.'

在 obj\x86\Debug 文件夹中有一个名为 WpfLocalizationTest.g.en-US.resources 的文件.我尝试在其上运行 locbaml,但结果是一样的.

In the obj\x86\Debug folder there's a file called WpfLocalizationTest.g.en-US.resources. I tried running locbaml on that, but the result was the same.

locbaml 应该如何使用?MSDN 充满了 cockamamie 样本,但没有一个有效.locbaml 真的是微软打算如何本地化 WPF 应用程序吗?或者他们是否为这项工作想出了合适的工具?

How is locbaml supposed to be used? MSDN is full of cockamamie samples, none of which work. Is locbaml really how Microsoft intends WPF apps to be localized? Or have they come up with proper tools for the job?

推荐答案

当我继续搜索时,我在 Stackoverflow 上找到了另一个链接.我们最初收到的编译错误与未为 .Net4.0 设置的过时 LocBaml 项目有关.这就是为什么我无法从 DLL 生成 CSV 文件而不得不直接查看资源文件的原因.点击此链接了解更多详情..net wpf4 应用程序的 Locbaml 本地化

As I continue to search I found another link here on Stackoverflow. The compile errors we were originally receiving were related to an outdated LocBaml project not being set for .Net4.0. This is why I was unable to generate teh CSV from the DLL and had to go straight at the resource file. Follow this link for more details. Locbaml localization of .net wpf4 application

此链接提供了一个指向 .net 4 二进制文件的链接,这些二进制文件编译后允许您直接进入 dll 以使用 LocBaml 生成 CSV.

This link provides a link to .net 4 binaries which once compilied allow you to go straight at the dll to generate the CSV using LocBaml.

这篇关于Locbaml 是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆