Clarify the difference between the LANGFILE and LANGFILE_EXT macros.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6454 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
da7d67e69d
commit
570f45019d
1 changed files with 32 additions and 7 deletions
|
@ -5,22 +5,47 @@ LangFile.nsh
|
||||||
Header file to create language files that can be
|
Header file to create language files that can be
|
||||||
included with a single command.
|
included with a single command.
|
||||||
|
|
||||||
Copyright 2008-2013 Joost Verburg, Anders Kjersem
|
Copyright 2008-2014 Joost Verburg, Anders Kjersem
|
||||||
|
|
||||||
* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT
|
* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT
|
||||||
can be called from the script to include a language
|
can be called from the script to include a language file.
|
||||||
file.
|
|
||||||
|
|
||||||
- LANGFILE_INCLUDE takes the language file name as parameter.
|
- LANGFILE_INCLUDE takes the language file name as parameter.
|
||||||
- LANGFILE_INCLUDE_WITHDEFAULT takes as additional second
|
- LANGFILE_INCLUDE_WITHDEFAULT takes as additional second
|
||||||
parameter, the default language file to load missing strings
|
parameter, the default language file to load missing strings from.
|
||||||
from.
|
|
||||||
|
|
||||||
* A language file must start by inserting the LANGFILE macro.
|
|
||||||
|
|
||||||
* Language strings in the language file have the format:
|
* Language strings in the language file have the format:
|
||||||
${LangFileString} LANGSTRING_NAME "Text"
|
${LangFileString} LANGSTRING_NAME "Text"
|
||||||
|
|
||||||
|
* There are two types of language header files:
|
||||||
|
|
||||||
|
- NSIS multi-lang support; these must start with the LANGFILE macro and
|
||||||
|
provide strings for features like MUI and MultiUser. If you are adding
|
||||||
|
support for a new language to NSIS you should make a copy of English.nsh
|
||||||
|
and translate this .nsh along with the .nlf.
|
||||||
|
- Custom installer strings; these must start with the LANGFILE_EXT macro and
|
||||||
|
contain translated versions of
|
||||||
|
custom strings used in a particular installer.
|
||||||
|
This is useful if you want to put the translations for each language in
|
||||||
|
their own separate file.
|
||||||
|
|
||||||
|
* Example:
|
||||||
|
|
||||||
|
; Setup.nsi
|
||||||
|
!include "MUI.nsh"
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
!insertmacro MUI_LANGUAGE "Danish"
|
||||||
|
!insertmacro LANGFILE_INCLUDE "DanishExtra.nsh"
|
||||||
|
!insertmacro MUI_LANGUAGE "Swedish"
|
||||||
|
!insertmacro LANGFILE_INCLUDE "SwedishExtra.nsh"
|
||||||
|
Section
|
||||||
|
MessageBox MB_OK "$(myCustomString)"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
; SwedishExtra.nsh
|
||||||
|
!insertmacro LANGFILE_EXT Swedish
|
||||||
|
${LangFileString} myCustomString "Bork bork"
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
!ifndef LANGFILE_INCLUDED
|
!ifndef LANGFILE_INCLUDED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue