Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to localize Inno Setup component and type names?

Tags:

inno-setup

How to localize component and type names? For example:

[Languages]
Name: "eng"; MessagesFile: "Idiomas\English.isl"
Name: "spa"; MessagesFile: "Idiomas\Spanish.isl"

If I choose English:

[Types]
Name: "full"; Description: "Full installation"
Name: "compact"; Description: "Compact installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "program"; Description: "Program Files"; Types: full compact custom; \
    Flags: fixed
Name: "readme"; Description: "Readme File"; Types: full

or if I choose Spanish:

[Types]
Name: "full"; Description: "Instalación Completa"
Name: "compact"; Description: "Instalación Mínima"
Name: "custom"; Description: "Instalación Personalizada"; Flags: iscustom

[Components]
Name: "program"; Description: "Archivos de Programa"; Types: full compact custom; \
    Flags: fixed
Name: "readme"; Description: "Archivo de Ayuda"; Types: full
like image 998
Nico Z Avatar asked Nov 08 '25 17:11

Nico Z


1 Answers

Define custom messages in the language files:

  • idiomas\English.isl:

    [CustomMessages]
    FullInstallation=Full installation
    CompactInstallation=Compact installation
    CustomInstallation=Custom installation
    ProgramFilesComponent=Program Files
    ReadmeFileComponent=Readme File
    
  • idiomas\Spanish.isl:

    [CustomMessages]
    FullInstallation=Instalación Completa
    CompactInstallation=Instalación Mínima
    CustomInstallation=Instalación Personalizada
    ProgramFilesComponent=Archivos de Programa
    ReadmeFileComponent=Archivo de Ayuda
    
  • or you can use the [CustomMessages] section in the main .iss file:

    [CustomMessages]
    eng.FullInstallation=Full installation
    spa.FullInstallation=Instalación Completa
    ...
    

And then use these custom messages using the {cm:MessageName} constant in your script:

[Types]
Name: "full"; Description: "{cm:FullInstallation}"
Name: "compact"; Description: "{cm:CompactInstallation}"
Name: "custom"; Description: "{cm:CustomInstallation}"; Flags: iscustom

[Components]
Name: "program"; Description: "{cm:ProgramFilesComponent}"; \
  Types: full compact custom; Flags: fixed
Name: "readme"; Description: "{cm:ReadmeFileComponent}"; \
  Types: full

English

Spanish

like image 124
Martin Prikryl Avatar answered Nov 12 '25 16:11

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!