Command line switch for language non-standard
Original Reporter info from Mantis: dbannon @davidbannon
-
Reporter name: David
Original Reporter info from Mantis: dbannon @davidbannon
- Reporter name: David
Description:
The command line switch to switch an application to a specific language relies on a space between the --lang and the desired value. For example, to select the Spanish language, you would put "--lang es" on the command line. However, the normal approach for long command line arguments in Lazarus applications is to separate the switch from a value using an equals sign - "--lang=es"
The attached patch retains the spaced based behaviour but also allows the Lazarus style '=' one as well.
Davo
Steps to reproduce:
In a simple application, add LCLTranslator, DefaultTranslator; to the uses clause and provide appropriate po or mo files in, eg, ./locale that support another language (for as a minium, the form's caption, "Form1"). Set run time parameter or start the app from the command line eg
./project1 --lang es &LtPos;enter>
The 'es' above indicates spanish and will require a translated messages file, ./locale/project1.es.mo
Repeat the exercise with a more Lazarus like syntax -
./project1 --lang=es &LtPos;enter>
And it won't change from the default language.
Additional information:
I have only tested on Linux but having looked at the existing code, seems pretty sure its a cross platform issue and a cross platform solution.
Mantis conversion info:
- Mantis ID: 35432
- Version: 2.0.3 (SVN)
- Fixed in version: 2.0.6
- Fixed in revision: 61041 (#ccf03e0d)
- Monitored by: » @davidbannon (David)