You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[The block] typically contains a list of languages that the application or DLL supports.
The structure should list the supported languages. This is a list with variable length. For example, it could look like VALUE "Translation", 0x409, 0x04b0, 0x0407, 0x04b0 for English (US) and German.
If you use the Var structure to list the languages that your application supports, the number of StringTable structures in the version resource is directly related to the number of language/code page identifier pairs in the Value member of the Var structure.
I'm not an expert with ResourceFiles but I think that you're supposed to add a StringTable (containing ProductName, ProductVersion, FileVersion, InternalName, etc.) for each language you support.
To create a multi-language resource file, the crate might need to become more modular, allowing one to set the StringTable strings for any language.
I think the best way to do this would be to have a function like add_translation(&mut self, language: u16) -> &mut StringTable that creates a StringTable struct for that language and returns it. You could set any String in a StringTable with a set function (like you do now), but unless you overwrite a value specifically for a specific language, the values given from Cargo or the global (current) set method would be used (like they are now).
This way, you wouldn't need to set the mostly same values over and over again but can use the crate like now and just call add_translation for each language that should be included, and you still have the possibility to overwrite specific values for each language. And all the added languages are included in the VarFileInfo block.
This would replace set_language.
What do you think about this?
The text was updated successfully, but these errors were encountered:
The VarFileInfo block in a ResourceFile looks roughly like this:
However, according to the Microsoft documentation
The structure should list the supported languages. This is a list with variable length. For example, it could look like
VALUE "Translation", 0x409, 0x04b0, 0x0407, 0x04b0
for English (US) and German.The Microsoft documentation further states that
I'm not an expert with ResourceFiles but I think that you're supposed to add a StringTable (containing ProductName, ProductVersion, FileVersion, InternalName, etc.) for each language you support.
To create a multi-language resource file, the crate might need to become more modular, allowing one to set the StringTable strings for any language.
I think the best way to do this would be to have a function like
add_translation(&mut self, language: u16) -> &mut StringTable
that creates aStringTable
struct for that language and returns it. You could set any String in aStringTable
with aset
function (like you do now), but unless you overwrite a value specifically for a specific language, the values given from Cargo or the global (current)set
method would be used (like they are now).This way, you wouldn't need to set the mostly same values over and over again but can use the crate like now and just call
add_translation
for each language that should be included, and you still have the possibility to overwrite specific values for each language. And all the added languages are included in the VarFileInfo block.This would replace
set_language
.What do you think about this?
The text was updated successfully, but these errors were encountered: