Localization 将premake与多个本地化一起使用
我与premake 5一起工作了几天。我目前正尝试将VS2015解决方案(主要是C++本地和CLI项目)移植到PrimeX 5解决方案中。到目前为止,我没有遇到任何问题,但现在我无法为我们将程序集本地化到的所有语言构建资源库。例如,如果我们有fr和es(法语和西班牙语),我们应该有这样的装配拆分:Localization 将premake与多个本地化一起使用,localization,c++-cli,premake,satellite-assembly,Localization,C++ Cli,Premake,Satellite Assembly,我与premake 5一起工作了几天。我目前正尝试将VS2015解决方案(主要是C++本地和CLI项目)移植到PrimeX 5解决方案中。到目前为止,我没有遇到任何问题,但现在我无法为我们将程序集本地化到的所有语言构建资源库。例如,如果我们有fr和es(法语和西班牙语),我们应该有这样的装配拆分: <EmbeddedResource Include="bar.resx"/> <None Include="bar.resx"/> premake.vstudio.vc20
<EmbeddedResource Include="bar.resx"/>
<None Include="bar.resx"/>
premake.vstudio.vc2010.categories.EmbeddedResource = {
name = "EmbeddedResource",
extensions = {".resx"},
priority = 50, -- arbitrary number, I saw priorities are 0, 1, 2...
emitFiles = function(prj, group)
premake.vstudio.vc2010.emitFiles(
prj,
group,
"EmbeddedResource",
{premake.vstudio.vc2010.generatedFile} -- cannot explain this...
)
end,
emitFilter = function(prj, group)
premake.vstudio.vc2010.filterGroup(prj, group, "EmbeddedResource")
end
}
(默认值,英语)foo.dll
- 卫星
用于其他语言(当然在不同的文件夹中分开)李>foo.resources.dll
编辑1 我将此添加到我的lua脚本中:
files({"/**.resx"})
它将.resx
文件添加到.vcxproj
文件中,但没有像这样包括:
<EmbeddedResource Include="bar.resx"/>
<None Include="bar.resx"/>
premake.vstudio.vc2010.categories.EmbeddedResource = {
name = "EmbeddedResource",
extensions = {".resx"},
priority = 50, -- arbitrary number, I saw priorities are 0, 1, 2...
emitFiles = function(prj, group)
premake.vstudio.vc2010.emitFiles(
prj,
group,
"EmbeddedResource",
{premake.vstudio.vc2010.generatedFile} -- cannot explain this...
)
end,
emitFilter = function(prj, group)
premake.vstudio.vc2010.filterGroup(prj, group, "EmbeddedResource")
end
}
但情况依然如此。我发现
buildaction
仅在C#中受支持(我的代码是在C++/CLI中)。如果这是真的(似乎是真的),那么有没有办法让我的脚本更深入地将XML条目直接添加到.vcxproj
?那么。。。经过多次尝试,我找到了一种方法。我刚刚为EmbeddedResource添加了一个新的(文件)类别,如下所示:
<EmbeddedResource Include="bar.resx"/>
<None Include="bar.resx"/>
premake.vstudio.vc2010.categories.EmbeddedResource = {
name = "EmbeddedResource",
extensions = {".resx"},
priority = 50, -- arbitrary number, I saw priorities are 0, 1, 2...
emitFiles = function(prj, group)
premake.vstudio.vc2010.emitFiles(
prj,
group,
"EmbeddedResource",
{premake.vstudio.vc2010.generatedFile} -- cannot explain this...
)
end,
emitFilter = function(prj, group)
premake.vstudio.vc2010.filterGroup(prj, group, "EmbeddedResource")
end
}
希望它能帮助