Commit Graph

89 Commits

Author SHA1 Message Date
Axel Dörfler
702526b17f * Added BLanguage::GetIcon(), and BLocaleRoster::GetFlagIconForLanguage(). The
former just calls the latter. Getting the flag for a language is pretty
  simplistic for now, but it won't return the wrong flag, just only a few known
  ones (should be enough for ReadOnlyBootPrompt, at least).
* Ordered methods in declaration order.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-25 17:09:30 +00:00
Jonas Sundström
28373dd18a Remove superfluous function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-31 07:17:05 +00:00
Jonas Sundström
ee6a2e5589 * Extend the Model class with a method bool HasLocalizedName().
* Disallow renaming of entries with localized names for now - this is meant to be temporary - and so far only in Tracker's Info window. Renames do not result in a change, visually, as the localized name hides the real name, and results in a bad user experience. One could possibly allow renames of the localized name, writing it back to the catalog. I've experimented with using BCatalogAddOn::SetString() but haven't been able to make it stick yet.
* Disallow renaming Trash in Tracker's Info window via Command-E.
* Adjust the argument order of BLocaleRoster::GetLocalizedFileName().
* Add a BLocaleRoster::GetLocalizedFileName() variant to look up another app's name given its signature and unlocalized, canonical name.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-27 18:38:05 +00:00
Jonas Sundström
560ff4478d Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-25 22:13:48 +00:00
Jonas Sundström
6f477364cc Make BLocaleRoster::GetLocalizedFileName() take a const entry_ref& rather than a non-const entry_ref&. Remove private GetLocalizedFileName() from libtracker and make Tracker and Deskbar use the one in BLocaleRoster.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-22 01:35:38 +00:00
Jonas Sundström
85366cb58b Add BLocaleRoster::GetLocalizedFileName()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-21 23:23:57 +00:00
Jonas Sundström
b6075d1fd2 Adding B_TRANSLATE_NOCOLLECT_APP_NAME. Reordered.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-15 16:00:58 +00:00
Jonas Sundström
41ad4911ad Make B_TRANSLATE_APP_NAME aware of BLocaleRoster::Default()->IsFilesystemTranslationPreferred().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 19:48:20 +00:00
Jonas Sundström
480d660fb0 Introducing a catalog app name context, related macros, and making use of this in DeskCalc.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40930 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 17:29:10 +00:00
Jonas Sundström
07cffb4786 Introducing a Locale option to display localized filesystem entries (primarily apps and folders) in Deskbar, Tracker, etc. Making use of this in Deskbar's list of apps. The option currently defaults to off, to avoid exposing everyone to unfinished work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-11 19:52:15 +00:00
Ingo Weinhold
25dc253d6a * Merged weak-symbols branch.
* Fixed trivial merge conflict in src/system/libroot/posix/locale/nl_langinfo.cpp
* Fixed gcc 2 compilation of src/system/glue/init_term_dyn.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-22 13:06:36 +00:00
Axel Dörfler
312f43920a * Added a B_TRANSLATE_WITH_CONTEXT() macro.
* Added a number of TODOs.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-02 21:36:35 +00:00
Oliver Tappe
6fd2f4a0d1 One more monster commit (sorry ...) concerning the Locale Kit:
* extracted new class BFormattingConventions from BCountry, which
  manages the formatting conventions from a given locale and 
  allows to get/set the four different date/time formats supported
  by ICU-locales as well as number and monetary formats
* overhauled the Locale preflet:
  + drop editing features for all formats, since I don't think
    they do not make much sense to have in a prefs GUI - being
    able to select from the existing locales should be good
    enough. Please note that you can still change the formats
    programmatically in an application.
  + renamed the 'Countries' tab to 'Formatting'
  + the locale formatting conventions list in the 'Formatting'
    tab is now hierarchical for easier access (less scrolling)
  + fixed functionality of 'Revert' and 'Defaults' buttons
  + added support for using the month/day-names of your preferred
    language during date formatting
* adjusted BLocale to ask BFormattingConventions for the current
  formats when formatting dates and times and to offer 4
  different format styles (full, long, medium and short).
* adjust all classes formatting dates/times to pick the 
  appropriate format style
* BLocaleRoster no longer directly archives/unarchives the 
  individual formatting conventions but delegates that to
  BFormattingConventions
    

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39123 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 12:57:55 +00:00
Oliver Tappe
6f43fabafb * some cleanup in BLocaleRoster
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-20 09:23:06 +00:00
Oliver Tappe
d1d8fda637 Next step of Locale Kit refactoring:
* BLocale now keeps language and country completely separate and
  mixes the formatting conventions into the current language's locale
  when formatting dates and times (needs to be done for number- and
  currency-formatting, too, since the digits may not be in the
  preferred language)
* optimized fetching of the flag icons such that they are all loaded
  in one go (by the locale roster) - this alone speeds up the Locale
  preflet considerably
* worked on fixing the language confusion in the Locale preflet
* fixed a couple of bugs in the Locale preflet that would lead to
  illegal characters being displayed in the date-subpart menus


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-19 21:36:44 +00:00
Oliver Tappe
b7f609650b * removed all BLocale-related getters from BLocaleRoster - they're available
in BLocale (which is accessible via be_locale)
* adjusted all users accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-30 19:58:19 +00:00
Oliver Tappe
2bd0cd6cb8 * improved const-correctness of BLocale
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-30 18:57:17 +00:00
Oliver Tappe
6e30c4b8af * rename BTimeZone::Accessor to BTimeZone::Private to match the other
private accessor classes
* adjust style in BTimeZone::Private implementation to match other classes
  of this kind


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-30 14:30:22 +00:00
Oliver Tappe
a9faf94392 * reintroduced be_locale as global information point for the current locale
values
* added locking to BLocale (needed since the data of the global object may
  change any time)
* BLocale no longer passes out pointers to internal objects, it fill objects
  passed in by the client instead (just like be_locale_roster does)
* dropped default language as member from RosterData, it is no part of the
  default locale
* fleshed out implementation of TimeUnitFormat and DurationFormat, both
  of which can now be given a BLocale in order to set the strings being used
  during formatting


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-29 20:55:00 +00:00
Oliver Tappe
279125fbd9 * added BTimeZone::Accessor class, which allows other LocaleKit classes to
access a BTimeZone's ICU-timeZone 

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38427 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-29 20:52:28 +00:00
Oliver Tappe
f3dd81ab9b * style adjustments
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-29 20:40:15 +00:00
Oliver Tappe
81fe5a9200 * re-added GetAvailableTimeZones() to BCountry - it is now a convenience wrapper
around BLocaleRoster::GetAvailableTimeZonesForCountry()
* minor cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 09:23:26 +00:00
Oliver Tappe
9ef134d918 * added timezone-support to some more date/time-formatting methods in BLocale
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 22:17:40 +00:00
Oliver Tappe
c91aa9f4e6 * moved support for getting timezones-by-country from BCountry to LocaleRoster,
since we'd like to be able to get the timezones of the global (i.e. empty)
  country, too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 22:16:40 +00:00
Oliver Tappe
aa8372c486 * changed BTimeZone to use BLanguage instead of BLocale, as that what represents
the locale of messages (timezone names in this case)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 18:32:59 +00:00
Adrien Destugues
4f5f77e6e4 Missing from previous commit. Sorry !
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 17:49:12 +00:00
Oliver Tappe
3bdedcf3f1 * added support for getting the names of a timezone for a specific locale
(not currently used anywhere, but should be part of the BTimeZone interface)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38333 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 15:03:54 +00:00
Oliver Tappe
750e57b842 Optimized Time preflet:
* use upon-demand initialization in BTimeZone to avoid unnecessary work
* renamed BTimeZone::Code() to BTimeZone::ID() and adjusted all callers
* avoid using BCountry in the Time preflet for the time being, this means
  the icon-flags are gone for now (but they could be re-added if the demand
  is pressing ;-)
* group the timezones by regions and then by country instead
The performance improvement is considerable and I personally think the new grouping is an improvement, too. Please share your thoughts!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 15:17:49 +00:00
Oliver Tappe
039ad7e757 Added support for getting a list of all available timezone IDs to LocaleRoster.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38321 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 14:46:54 +00:00
Oliver Tappe
c639a77808 * moved BDateElement from BCountry to BLocale, as that's where it's being used
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-16 20:19:51 +00:00
Oliver Tappe
f23b9d8a72 * added possibility to pass in the timezone when formatting the time
* added TODOs about the need to get rid of some of the date/time-formatting
  shortcut methods

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-16 15:03:54 +00:00
Adrien Destugues
4a7b2e0484 * Add FormatDateTime function to BLocale
* Use the function to localize the date/time in tracker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-07 11:22:16 +00:00
Oliver Tappe
e4da3d6691 * added support for all the different names (std/dst, long/short) and daylight
support to BTimeZone

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 21:44:38 +00:00
Adrien Destugues
4ebeabb639 * Remove GetLocaleName from BCountry
* Add GetName to BLocale instead


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 10:19:22 +00:00
Adrien Destugues
5c3a303486 * Move the locale-related stuff away from BCountry to BLocale.
* Remove the be_locale global object and go through the be_locale_roster instead
 * Rework the storage of data for the be_locale_roster, since BLocale already holds a BCountry and a BLanguage.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 18:45:06 +00:00
Oliver Tappe
38ac8def5a Largish cleanup sweep concerning the Locale Kit (sorry it got so big):
* refactored private/mutable stuff out of LocaleRoster into MutableLocaleRoster
* moved management of Locale/Time settings file and broadcasting of any changes 
  out of preflets and into MutableLocaleRoster
* added proper sorting to the listviews of the Locale preflet
* the Time preflet no longer overlaps long timezone names into the actual time
* several fixes with respect to leaking ICU objects, esp. in BCountry
* the locale roster no longer passes out references to its own BCountry object,
  but uses copies, instead - this makes locking superfluous, as the clients'
  BCountry objects can no longer be changed by the setting a new default 
  country in the locale roster
* removed pretty useless POSIX-style symbol fetching from BCountry - if we
  need that at all, it should live in the dedicated formatter classes
* adjusted readonlybootprompt, dstcheck and Deskbar to the changed Locale API
* refactored existing Time-formatter into TimeUnitFormat and DurationFormat
  (the latter of which is now used by AboutSystem)
* added stubs for Date, DateTime and Time formatters
* lots of coding style fixes throughout the Locale Kit and the Locale and Time 
  preflets
This will probably break most external apps making use of the Locale Kit - it
does break WebPositive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-01 20:28:19 +00:00
Oliver Tappe
99d2aa985b Improved the Time preflet (still not working properly, though)
* basically rewrote TimeZone to sport a nicer to use interface
* adjusted all users of TimeZone accordingly
* changed TZDisplay to show the Date next to the label, in
  order to avoid that long timezone names draw all over it
* the timezone listview is now properly sorted according
  to the current language (using BCollator)
* fixed a couple of bugs (overflows, etc.) that caused
  incorrect GMT offsets to be used during computations


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-29 20:10:26 +00:00
Adrien Destugues
1c99030935 * Style fixes pointed out by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-28 14:45:54 +00:00
Adrien Destugues
2c6ebfaaea * Fix collator text
* Fix archiving/unarchiving to provide at least a valid object. However, ICU archiving system doesn't look like it's working well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37784 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-28 13:16:11 +00:00
Adrien Destugues
110649a1a4 * Collator API now actually uses ICU.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-28 11:29:14 +00:00
Adrien Destugues
1855b44cdf * Set the ICU default time zone from the locale preflet. Unfortunately it looks like this doesn't solve all the problems
yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-27 09:45:52 +00:00
Oliver Tappe
c090a0fd84 * updated ICU build packages with newer builds that try a bit harder to avoid
warnings and incorporate some of the ICU-patches we had in our repo before
  we upgraded to 4.4.1
* fixed remaining warnings when building locale kit
* activated EnableWerror for locale kit
* added 'Unicode' license, which is the second license in use by ICU


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37763 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-26 22:05:39 +00:00
Adrien Destugues
4ae5a45220 * Rewrote the timezone selection part of the time preflet to make use of ICU instead of our custom TZData.
* Not completely working yet, hte POSIX API isn't very happy about ICU timezone names.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-26 13:56:50 +00:00
Oliver Tappe
ad51686353 * improved the locale kit build rules and headers to use a different set of
B_TRANSLATE-macros when running collectcatkeys, simplifying the regex a lot
* added B_TRANSLATE_NOCOLLECT...-macros for the case where a non-literal
  string shall be translated, but not picked up by collectcatkeys


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-25 22:47:39 +00:00
Oliver Tappe
b891b0acae * broke out locale-related jam rules into their own file, LocaleRules
* made locale build tools shut up about anything except warnings or errors


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 19:56:24 +00:00
Adrien Destugues
282582c005 * Bcountry : private methods start with underscore. The timezone list isnow actually a list of BTimeZone objects, that holdsall the needed info, not only the code. Also tweak the listing code to
remove duplicatesfromthe list generated by ICU.
 * BTimeZone : remove Code, rename Name to GetName. The class is likely to change again for further optimization.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 16:25:43 +00:00
Adrien Destugues
2774e142e1 * Add a BTimeZone class for handling time zones.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 13:19:33 +00:00
Adrien Destugues
6c178e1e73 * Add locking system to BCountry to avoid problems with the formatters being deleted while you use them, or created multiple times.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 11:38:37 +00:00
Adrien Destugues
f48ad0d968 * Style fixes (some pointed out by Axel, some others by the vim stylechecker).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37698 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 16:52:49 +00:00
Adrien Destugues
d4f3002de9 * BCountry : add error checking in case the system runs out of memory, cleanup function prototypes (we don't need virtual, this was a leftover of
OpenTracker days)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 16:36:36 +00:00