Skip to content
Browse files

`languages` now returns "localized (unlocalized)" pairs

  • Loading branch information...
1 parent 315282d commit 20afe81775b9a9b9cae892adb5322fb8092e9480 @ptaoussanis committed Apr 20, 2014
Showing with 7 additions and 5 deletions.
  1. +1 −0 CHANGELOG.md
  2. +6 −5 src/taoensso/tower.clj
View
1 CHANGELOG.md
@@ -1,6 +1,7 @@
## Pending / unreleased
* **CHANGE**: Default :missing translations entry now avoids <>'s (no need for html escaping).
+ * **CHANGE**: `languages` now returns languages as "localized (unlocalized)" pairs rather than "unlocalized (localized)" pairs.
## v2.1.0-RC1 / 2014 Mar 30
View
11 src/taoensso/tower.clj
@@ -234,13 +234,14 @@
([loc iso-languages]
(get-localized-sorted-map iso-languages (locale loc)
(fn [code] (let [Loc (Locale. (name code))]
- (str (.getDisplayLanguage Loc (locale loc))
- ;; Also provide each name in it's OWN language
- (when (not= Loc (locale loc))
- (str " (" (.getDisplayLanguage Loc Loc) ")"))))))))))
+ (str (.getDisplayLanguage Loc Loc) ; Lang, in itself
+ (when (not= Loc (locale loc))
+ (format " (%s)" ; Lang, in current lang
+ (.getDisplayLanguage Loc (locale loc))))))))))))
(comment (countries :en)
- (languages :pl [:en :de :pl]))
+ (languages :pl [:en :de :pl])
+ (languages :en [:en :de :pl]))
;;;; Timezones (doesn't depend on locales)

0 comments on commit 20afe81

Please sign in to comment.
Something went wrong with that request. Please try again.