Opened 18 months ago

Last modified 7 days 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
Has a Patch: no 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 18 months ago.
0003-Reduce-levels-of-nesting-in-setlocale.patch (1.4 KB) - added by KeyboardFire 18 months ago.
0004-Capitalize-output-of-setlocale.patch (827 bytes) - added by KeyboardFire 18 months ago.
0001-Implement-new-setlocale-command.patch (4.3 KB) - added by KeyboardFire 18 months ago.
0001-Link-the-setlocale-tool.patch (1.4 KB) - added by lezsakdomi 18 months ago.
Path to add the tool into images
0002-Improve-argument-parsing.patch (5.1 KB) - added by lezsakdomi 18 months ago.
Use getopt
0003-Statisfy-the-Coding-Guidelines.patch (5.5 KB) - added by lezsakdomi 18 months ago.
Depends on 0002-Improve-argument-parsing.patch
0003-Improve-the-setlocale-command.patch (9.5 KB) - added by lezsakdomi 18 months 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 Changed 18 months ago by KeyboardFire

Has a Patch: set

Changed 18 months ago by KeyboardFire

Changed 18 months ago by KeyboardFire

Changed 18 months ago by KeyboardFire

Changed 18 months ago by KeyboardFire

comment:2 Changed 18 months ago by pulkomandy

  • 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)

Changed 18 months ago by lezsakdomi

Path to add the tool into images

Changed 18 months ago by lezsakdomi

Use getopt

Changed 18 months ago by lezsakdomi

Depends on 0002-Improve-argument-parsing.patch

Changed 18 months ago by lezsakdomi

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

comment:3 Changed 18 months ago by lezsakdomi

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

comment:4 Changed 17 months ago by pulkomandy

Has a Patch: unset

comment:5 Changed 17 months ago by pulkomandy

Has a Patch: unset

comment:6 Changed 13 months ago by pulkomandy

Blocking: 13837 added

comment:7 Changed 7 days ago by waddlesplash

Component: - GeneralApplications/Command Line Tools
Has a Patch: unset
Note: See TracTickets for help on using tickets.