I have multiple language packs in my NSIS installer, using the MUI2 interface. Now I try to select the language pack, which is installed by the "Typical" installation type according to the user's chosen setup language. My problem is, that I can't figure out, how to get the user's language selection.
I already tried to access the variables $LANGUAGE and $mui.LangDLL.RegistryLanguage, as well as trying to compare a defined language string to a specific translation string, but without success.
The language can only be set in .onInit (By using the LangDll plugin or setting $LANGUAGE directly) After .onInit, language strings are loaded but you can still check $LANGUAGE to get the language id...
Related
We have decided to use the Dotfuscator to obfuscate our code. Ours is a Windows Phone application and we are using Dotfuscator Windows Phone Edition Version 4.9.7000.29303. We learnt that System.Reflection.ObfuscationAttribute class is not available in Silverlight, so it is not possible to use exclusion attributes on some types we need to exclude. We are now planning to use Rename>Exclude tab in dotfuscator and exclude types with some specific suffixes. Before implementation we created a trial project and tested obfuscation on it. We found in our testing that the output is not adhering to execution rules. Though the preview window is showing expected result but output still includes those types which should have been excluded. Please see the screen shot of the Dotfuscator window below. Preview window on the left hand side of the arrow is correctly displaying the shaded type which would be excluded from obfuscation, but on the right hand side of the arrow, output of the same still obfuscated those types. What is happening?
I don't entirely understand what you're trying to accomplish with the regular expression, but as far as using attributes to control obfuscation, there is a library you can include.
The library to include is typically in
C:\Program Files(x86)\PreEmptive Solutions\Dotfuscator (version and edition)\Attributes\Windows Phone\PreEmptive.ObfuscationAttributes.dll
Here is an example on how to exclude something from renaming for instance:
[Obfuscation(Feature = "renaming", Exclude = true)]
public int Foo{get;set;}
You can find more details about it controlling obfuscation with attributes at this link and the general users guide is available here
If you want to go the regex route instead, you can also look at the documentation for creating custom rules. You'll have to provide a bit more info for me to understand what you're trying to do for me to be able to help though. Given your screenshot, everything appears to be what I'd expect.
What language are NSIS scripts written in?
Is it NSIS's own language or is it a common language or even Assembly itself? Its looks very familiar to Assembly. I've looked on the website to try to find out what language it is but it doesn't explain what language it is.
The instructions that NSIS uses for scripting are sort of a cross
between PHP and assembly.
That is what the manual has to say. The scripting language is unique to NSIS, I don't really see the point of comparing it to other languages. (NSIS evolved from the basic Winamp plugin installer, more history available here)
Several years ago the LogicLib was added which added "high" level macros so you can do basic If's and loops without goto's. Calling functions and plugins still require push'ing parameters to a stack asm style.
The language basically has three types of instructions:
Preprocessor (defines, includes and macros etc), they start with ! (!if 1 > 0)
Attributes/Properties: Icon, Version info etc
Instructions executed during install/uninstall (Instructions are placed inside functions and sections)
The installer UI consists of one or more pages. Each page can execute code based on several callback functions (Show, Leave etc) but most instructions are executed on the instfiles page (A page with a progress bar and log window) The instfiles page executes the code in all the sections. A section is basically a collection of files and instructions used to organize your installer into different parts. If the installer includes a component page, the user is given a list where they can choose which sections to execute.
The full list of instructions can be found in the source (This list does not include plugins and helper macros from external include files) The compiler (makensis.exe) validates and compresses these instructions (along with other files you have included) into a blob that is appended to a small GUI application written in C. This little application interprets these instructions...
It is their own 'language' loosely based on assembler.
From what I understand, it compiles this down to native code, and hence why the installer is so small :)
I am facing the following issue:
I have translated my application into different languages using resx files. I want to use the same resx files in other apps as well.
For different apps, I should be able to change the default language (some apps will only be available in Spanish, others only in English, and others multilingual)
I figured I could just name the resources LanguageStrings.es.resx and LanguageStrings.en.resx, and use NeutralResourcesLanguageAttribute to set the default language of the app.
However, when there is no LanguageStrings.resx (invariant file) in the app, the application seems to break (MissingManifestResourceException). I thought the Resource Manager should use the setting in NeutralResourcesLanguageAttribute to find the correct resource (for example; fall back to Spanish) instead of looking for a neutral file.
Is my assumption correct and am I running into a platform bug? I have noticed that ResourceManager.GetNeutralResourcesLanguage doesn't returned the language defined using NeutralResourcesLanguageAttribute, but invariant culture instead
Without a invariant resource file (LanguageStrings.resx), the compiler won't pick it up. You should let the English resource file (Currently LanguageStrings.en.resx) be the invariant file, ie. without .en in the filename, and then set
[assembly: NeutralResourcesLanguage("en")]
All .NET applications work this way. It's not a unique "issue" to Windows Phone.
I believe if you specify your language as supported in the element in your csproj - you need to have the resx that you are trying to use in the supported culture. If you use the language that is supposedly supported and the resx is not there - you will get a MissingManifestResourceException. Neutral language will be picked up if the current language is not supported.
I have localized version of Visual Studio and in new solutions XML-documentation from Base Class Library is displayed in IntelliSense in my language. But when I open solutions downloaded from Internet, this documentation is displayed in English. How can I choose this language?
I looked over project and solution properties and but did not found such setting. Changing language of assembly does not affects this. Possibly IntelliSense language setting is stored in hidden .suo file, but is is in binary format.
Actually I need to change documentation language because I am using GhostDoc and it generates documentation for member overloads in current IntelliSense language while generating all other documentation in English. GhostDoc also does not have such setting.
A little late but the answer is:
There is no such setting.
GhostDoc searches for the documentation of the .NET assemblies which are referenced.
Therefore if an english dll is referrenced, the documentation is in english
It is even worse, existing comments for own written methods seem tobe from file code model of VS, base classes from their documentation.
So you can have the case that you try to "ghostcomment" a method and get english, and another one is displayed in spanish )...
I am implementing one mac application.Its window version is already implemented.Now i am facing the following issue:
Implementation of new package with multi language (user could choose the language of the application while installing the app). ie For the windows version of the software, when executing the installation file user could choose the language in which the application should be installed. I want this feature to included in the mac version. ie the while installing the app using the package created the user should be able to choose the language of installation.(Currently in the mac version multilanguage is implemented using NSLocalizedString so that the app displays language according to the machine language and the installation package is localized). But i specifically want the users to be able to choose the installation language of the app, while installing.Pls help to solve this issue….
Use NSString *locString = NSLocalizedStringFromTable(#"key", #"Japanese", #"comment for key"); instead ;)
Explanation:
If you look at NSLocalizedString macro definition you will find that it actually calls -[NSBundle localizedStringForKey:value:table:] method in which the last parameter is the localization file (ie: Localizable.strings). You can get available localizations with-[NSBundle localizations]; method.
This means that you could use it to directly access a localization file like this:
// This gets the localized string found in Japanese.strings for the key #"key"
NSString *locString = [thisBundle localizedStringForKey:#"key"
value:#"No translation"
table:#"Japanese"];
Or use the macro (Which is almost equivalent)
NSString *locString = NSLocalizedStringFromTable(#"key", #"Japanese", #"comment for key");
The difference is what happens when the given key is not available:
the former returns #"No translation"
the latter returns the default localization for #"key"
Please see NSBundle class reference for more details
Hope it helps