Opened 6 years ago

Last modified 5 years ago

#13828 new enhancement

Implement new setlocale command

Reported by: KeyboardFire Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/Development
Keywords: locale Cc:
Blocked By: Blocking: #13837
Platform: All

Description

This is a command line utility for setting the system locale, created for a Google Code-In task.

Attachments (8)

0002-Fix-style-in-setlocale.patch (4.1 KB ) - added by KeyboardFire 6 years ago.
0003-Reduce-levels-of-nesting-in-setlocale.patch (1.4 KB ) - added by KeyboardFire 6 years ago.
0004-Capitalize-output-of-setlocale.patch (827 bytes ) - added by KeyboardFire 6 years ago.
0001-Implement-new-setlocale-command.patch (4.3 KB ) - added by KeyboardFire 6 years ago.
0001-Link-the-setlocale-tool.patch (1.4 KB ) - added by lezsakdomi 6 years ago.
Path to add the tool into images
0002-Improve-argument-parsing.patch (5.1 KB ) - added by lezsakdomi 6 years ago.
Use getopt
0003-Statisfy-the-Coding-Guidelines.patch (5.5 KB ) - added by lezsakdomi 6 years ago.
Depends on 0002-Improve-argument-parsing.patch
0003-Improve-the-setlocale-command.patch (9.5 KB ) - added by lezsakdomi 6 years ago.
Varios changes to make it complete. Depends on 0001-Implement-new-setlocale-command.patch

Download all attachments as: .zip

Change History (15)

comment:1 by KeyboardFire, 6 years ago

patch: 01

by KeyboardFire, 6 years ago

by KeyboardFire, 6 years ago

by KeyboardFire, 6 years ago

comment:2 by pulkomandy, 6 years ago

  • I saw some style guides violations and other strangeness (++i in for loop, for example, use of xor on booleans (!= should be used),)
  • Command-line parsing should be done using getopt() and not ad-hoc code
  • It would be better to use the usual language_country naming for languages (en_US, fr_FR, etc)
  • Iterating over all languages to find the one we want to use is inefficient and useless, it is possible to create a BLanguage instance directly from the language and country code
  • The code for listing languages and for setting a language should be separate (I would make them two different functions)

by lezsakdomi, 6 years ago

Path to add the tool into images

by lezsakdomi, 6 years ago

Use getopt

by lezsakdomi, 6 years ago

Depends on 0002-Improve-argument-parsing.patch

by lezsakdomi, 6 years ago

Varios changes to make it complete. Depends on 0001-Implement-new-setlocale-command.patch

comment:3 by lezsakdomi, 6 years ago

Ps.:
I ended up maintaing a clean commit history. The attached patch contains 0003-Statisfy-the-Coding-Guidelines.patch.

comment:4 by pulkomandy, 6 years ago

patch: 10

comment:6 by pulkomandy, 6 years ago

Blocking: 13837 added

comment:7 by waddlesplash, 5 years ago

Component: - GeneralApplications/Command Line Tools
patch: 0
Note: See TracTickets for help on using tickets.